Skip to content

monitor: add HMP info version and MMP query-version (#79)#123

Merged
zevorn merged 1 commit into
gevico:mainfrom
Lfan-ke:feat/79-version-commands
May 23, 2026
Merged

monitor: add HMP info version and MMP query-version (#79)#123
zevorn merged 1 commit into
gevico:mainfrom
Lfan-ke:feat/79-version-commands

Conversation

@Lfan-ke
Copy link
Copy Markdown
Collaborator

@Lfan-ke Lfan-ke commented May 9, 2026

Summary

Closes #79. Neither HMP nor MMP exposed the machina build version,
forcing users to read `Cargo.toml` to report a bug. Add a small
version surface to both.

  • `monitor/src/hmp.rs`: new `version` arm in `handle_info` that
    returns `machina <CARGO_PKG_VERSION>`; `help_text()` grows a
    matching line.
  • `monitor/src/mmp.rs`: new `query-version` arm in `dispatch` that
    returns `{"return": {"package": "machina", "version": "<...>"}}`.
  • `tests/src/monitor.rs`: three tests covering the HMP output, the
    help-text regression, and the MMP JSON shape. The expected version
    comes from `env!("CARGO_PKG_VERSION")` so the tests follow the
    workspace version automatically.

Test plan

  • `cargo fmt --all --check`
  • `cargo clippy --workspace -- -D warnings -A clippy::pedantic -A clippy::nursery`
  • `cargo test -p machina-tests --lib version`

@Lfan-ke
Copy link
Copy Markdown
Collaborator Author

Lfan-ke commented May 9, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 75c87cd16a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread monitor/src/mmp.rs Outdated
@Lfan-ke Lfan-ke force-pushed the feat/79-version-commands branch from 75c87cd to 9be6e78 Compare May 10, 2026 02:45
@Lfan-ke
Copy link
Copy Markdown
Collaborator Author

Lfan-ke commented May 10, 2026

@codex review

1 similar comment
@Lfan-ke
Copy link
Copy Markdown
Collaborator Author

Lfan-ke commented May 10, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9be6e781f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/src/monitor.rs
@Lfan-ke
Copy link
Copy Markdown
Collaborator Author

Lfan-ke commented May 10, 2026

@codex review please

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9be6e781f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread monitor/src/mmp.rs Outdated
@Lfan-ke
Copy link
Copy Markdown
Collaborator Author

Lfan-ke commented May 10, 2026

@codex review this pr please.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9be6e781f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread monitor/src/mmp.rs Outdated
@Lfan-ke Lfan-ke force-pushed the feat/79-version-commands branch from 9be6e78 to 43c5c16 Compare May 11, 2026 15:08
Lfan-ke added a commit to Lfan-ke/machina that referenced this pull request May 12, 2026
cargo fmt --check on CI (linux) wants the three-element tuple split
across lines. Local rustfmt did not flag this when the file was
first added, so the diff slipped past pre-push. Apply the rustfmt
suggestion verbatim to clear the failing fmt-check job on PR gevico#123.

Signed-off-by: Leo Cheng <chengkelfan@qq.com>
@zevorn
Copy link
Copy Markdown
Member

zevorn commented May 20, 2026

@codex Please review this PR thoroughly again.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b0f984138

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread monitor/src/mmp.rs
@Lfan-ke Lfan-ke force-pushed the feat/79-version-commands branch from 4b0f984 to b1ee0f5 Compare May 21, 2026 04:34
@zevorn
Copy link
Copy Markdown
Member

zevorn commented May 21, 2026

@codex Please review this PR thoroughly again.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@zevorn
Copy link
Copy Markdown
Member

zevorn commented May 22, 2026

@Lfan-ke please fix ci failed

@Lfan-ke
Copy link
Copy Markdown
Collaborator Author

Lfan-ke commented May 22, 2026 via email

Add an `info version` HMP command that returns `machina <semver>` and a
`query-version` MMP command that returns the QMP-compatible VersionInfo
shape {"qemu":{"major","minor","micro"},"package":"machina"}.

Both the MMP greeting and query-version derive their version triple from
CARGO_PKG_VERSION via a shared helper, so a single session never
advertises conflicting versions to a client.

Signed-off-by: Leo Cheng <chengkelfan@qq.com>
@Lfan-ke Lfan-ke force-pushed the feat/79-version-commands branch from b1ee0f5 to ca5f6ba Compare May 22, 2026 14:56
@zevorn zevorn merged commit fadf1ed into gevico:main May 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Open Source Workshop] Add HMP/MMP info version/query-version commands

2 participants