feat(vis): expose app_version in wire.jsonl metadata for debug#656
feat(vis): expose app_version in wire.jsonl metadata for debug#656bj456736 wants to merge 1 commit into
Conversation
- 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.
|
commit: |
There was a problem hiding this comment.
💡 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 }; |
There was a problem hiding this comment.
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 👍 / 👎.
Problem
wire.jsonl metadata already contains
app_versionwritten 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
app_versionfrom the metadata record and exposes it in the returned metadataappVersionfieldapp_versionfor validationappVersionis correctly parsedTechnical Choice
Minimal surface change: only the vis server's read path is modified. The write path in agent-core already emits
app_versionwhenappVersionis available (populated from CLI package.json viaidentity.version). This fix bridges the gap between what's written and what's readable.Changes
apps/vis/server/src/lib/wire-reader.ts— readapp_versionfrom metadataapps/vis/server/src/lib/agent-record-types.ts— addappVersionto WireResponse metadataapps/vis/server/test/fixtures/...— addapp_versionto fixture metadataapps/vis/server/test/lib/wire-reader.test.ts— assertappVersionis parsedTest
appVersionassertion ✓