Skip to content

feat(vis): expose app_version in wire.jsonl metadata for debug#656

Open
bj456736 wants to merge 1 commit into
MoonshotAI:mainfrom
bj456736:feat/wire-app-version
Open

feat(vis): expose app_version in wire.jsonl metadata for debug#656
bj456736 wants to merge 1 commit into
MoonshotAI:mainfrom
bj456736:feat/wire-app-version

Conversation

@bj456736

Copy link
Copy Markdown
Contributor

Problem

wire.jsonl metadata already contains app_version written by agent-core, but the vis server's wire reader ignores it. This makes version debugging impossible from the vis UI — when investigating issues, we can't tell which kimi-code CLI version produced a given wire file.

Solution

  1. WireReader reads app_version from the metadata record and exposes it in the returned metadata
  2. WireResponse type updated to include optional appVersion field
  3. Test fixtures updated with app_version for validation
  4. Tests verify appVersion is correctly parsed

Technical Choice

Minimal surface change: only the vis server's read path is modified. The write path in agent-core already emits app_version when appVersion is available (populated from CLI package.json via identity.version). This fix bridges the gap between what's written and what's readable.

Changes

  • apps/vis/server/src/lib/wire-reader.ts — read app_version from metadata
  • apps/vis/server/src/lib/agent-record-types.ts — add appVersion to WireResponse metadata
  • apps/vis/server/test/fixtures/... — add app_version to fixture metadata
  • apps/vis/server/test/lib/wire-reader.test.ts — assert appVersion is parsed

Test

  • All 46 vis-server tests pass ✓
  • 4 wire-reader tests pass including new appVersion assertion ✓

- WireReader now reads app_version from metadata record
- WireResponse metadata includes optional appVersion field
- Test fixtures updated with app_version for validation

This makes the kimi-code CLI version visible in the vis server
wire response, helping debug version-related issues.
@changeset-bot

changeset-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 09fbdef

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 11, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@09fbdef
npx https://pkg.pr.new/@moonshot-ai/kimi-code@09fbdef

commit: 09fbdef

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 09fbdefd14

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

migrations = bestEffortMigrations();
}
metadata = { protocolVersion: pv, createdAt: ca };
metadata = { protocolVersion: pv, createdAt: ca, appVersion: typeof av === 'string' ? av : undefined };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use the latest metadata appVersion

For sessions created before app_version existed, AgentRecords.replay() can append a later metadata record with resumed: true and the current app_version when the app version changes, but this endpoint-level metadata is frozen from only the first header line. In that common resumed-session case the wire contains an app_version, yet /wire still returns metadata.appVersion as undefined or stale, defeating the new debug field; update the reader when subsequent metadata records are encountered or otherwise choose the newest metadata value.

Useful? React with 👍 / 👎.

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.

1 participant