Skip to content

Unify app -> agent naming in handshake metadata (#190)#199

Merged
msk merged 4 commits into
mainfrom
octoaide/issue-190-2026-05-27T21-01-38
May 29, 2026
Merged

Unify app -> agent naming in handshake metadata (#190)#199
msk merged 4 commits into
mainfrom
octoaide/issue-190-2026-05-27T21-01-38

Conversation

@octoaide

@octoaide octoaide Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR renames client handshake metadata fields that used
'app_' to 'agent_' to make it explicit that the client-side
component is an agent (not a standalone server). It aligns
ConnectionBuilder and AgentInfo naming, updates tests and the
CHANGELOG, and preserves wire compatibility.

What changed

  • ConnectionBuilder: app_name -> agent_name, app_version ->
    agent_version (remote_* fields unchanged)
  • AgentInfo: app_name/version -> agent_name/agent_version
  • Tests: APP_NAME/APP_VERSION -> AGENT_NAME/AGENT_VERSION
  • Added serde compatibility: deserialization accepts legacy
    keys (app_name, app_version, version) so existing handshake
    payloads continue to be accepted
  • CHANGELOG and Cargo.toml updated; unit tests added/updated

Compatibility notes

  • Bincode handshake payloads remain compatible (field order
    and types unchanged)
  • JSON/serde deserialization is backward compatible with the
    legacy key names listed above

Files touched (high level)

  • src/client.rs
  • src/lib.rs
  • src/test.rs
  • Cargo.toml
  • CHANGELOG.md

References

Closes #190
#190

Address issue #190 by unifying service naming and correcting misused
agent terminology in handshake metadata. Rename app_* metadata keys to
agent_* to reflect the intended naming while preserving legacy
compatibility during the transition
@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.61%. Comparing base (257921f) to head (e5cc047).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #199   +/-   ##
=======================================
  Coverage   85.61%   85.61%           
=======================================
  Files          15       15           
  Lines        6481     6481           
=======================================
  Hits         5549     5549           
  Misses        932      932           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pott-cho pott-cho left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you make the following changes?

  1. Remove the tests added in lib.rs. I think they are unnecessary for this change.

  2. Update the app-like test value in client.rs.
    There is still an app-like test value:

    ConnectionBuilder::new(
        "test-server",
        "127.0.0.1:443".parse().unwrap(),
        "app",
        ...
    )

    Since this PR renames the client-side metadata to agent_*, please update this value to something agent-oriented, such as "test-agent", for consistency.

  3. Revise the CHANGELOG entry.
    The current CHANGELOG entry seems a bit misleading. Please change it to something like this:

    - Renamed handshake metadata fields from `app_name` / `version` to
      `agent_name` / `agent_version` in `ConnectionBuilder` and `AgentInfo`.
    
  4. Fix the CHANGELOG format.

    Please change ## Unreleased to ## [Unreleased], and add the [Unreleased] link reference at the bottom of the file. For example:

    [Unreleased]: https://github.com/petabi/review-protocol/compare/0.19.0...main
    

Unify handshake metadata by renaming app_name/version to
agent_name/agent_version in ConnectionBuilder and AgentInfo.

Remove now-redundant agent_info unit tests and unused std::net
imports, update certificate-chain tests to use "test-agent", and
fix CHANGELOG heading and link references. All tests pass locally
(200 tests).
@octoaide

octoaide Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

I reviewed your comments and made the requested changes — then committed and pushed them.

What I changed

  • Removed the unit tests in lib.rs: I deleted the four agent_info_* serialization/deserialization tests and the sample_agent_info helper (these were redundant for this change).
  • Updated client.rs tests: replaced the app-like test value ("app") with an agent-oriented value ("test-agent") in the four ConnectionBuilder::new calls used by the certificate-chain tests.
  • Updated CHANGELOG: rewrote the Unreleased line to clearly state the intent:
    • "Renamed handshake metadata fields from app_name / version to agent_name / agent_version in ConnectionBuilder and AgentInfo."
    • Fixed the header to ## [Unreleased] and added the link reference at the bottom:
      [Unreleased]: 0.19.0...main
  • Cleanups: removed now-unused imports (std::net) from the lib.rs test module after removing those tests.

Verification

  • Ran cargo test --all-features — all tests passed (200 tests) with no warnings.

Thanks for the clear review — these updates should address all four items you raised. If you want the CHANGELOG wording adjusted further, I can tweak it.

Comment thread Cargo.toml Outdated
"std",
] }
rustls-pemfile = "2"
serde_json = "1.0.150"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

serde_json is no longer used anywhere. Please remove it.

@octoaide

octoaide Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

I reviewed your comment and found that serde_json was no longer referenced anywhere in the codebase. I removed the unused dependency (serde_json = "1.0.150") from Cargo.toml, committed the change, and pushed it to the branch.

This keeps the manifest lean and avoids shipping an unnecessary dependency. I also verified the project builds after the removal. Thanks for pointing that out — it’s been addressed.

Comment thread src/lib.rs
Comment on lines +167 to +170
#[serde(rename = "agent_name", alias = "app_name")]
pub agent_name: String,
#[serde(rename = "agent_version", alias = "app_version", alias = "version")]
pub agent_version: String,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please remove the serde attributes above.

@msk msk merged commit b2f4e12 into main May 29, 2026
22 checks passed
@msk msk deleted the octoaide/issue-190-2026-05-27T21-01-38 branch May 29, 2026 02:22
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.

Unify service naming and fix misused agent naming

2 participants