feat: background-agent model display, v1 wire 1.5 support, AGENTS.md map trim - #21
Merged
Merged
Conversation
Background spawns append their started/completed/failed transcript entry synchronously from subagent.spawned, which carries the bound model alias on the v2 engine. Resolve it through modelDisplayName and render it in the headline: 'coder agent (GLM 5.2) started in background'. v1 spawns carry no model on the event, so their entries render unchanged.
agent-core-v2 bumped the wire protocol to 1.5 (upstream MoonshotAI#1695), so sessions written through kap-server / kimi web replayed in the v1 TUI with a 'newer than the current version 1.4' warning and no migration. Port the engine-agnostic 1.4 to 1.5 migration (backfill the goal wall-clock anchor from the record timestamp) into agent-core and bump AGENT_WIRE_PROTOCOL_VERSION to 1.5, matching upstream v2.
The Project Map section grew to 17.7 KB of the 25 KB root AGENTS.md, against the file's own rule to stay limited to hot-path rules — and it single-handedly pushed the merged AGENTS.md prompt context past the recommended 32 KB budget. Move the detailed per-package prose into package-local AGENTS.md files (kap-server, transcript, minidb, tree-sitter-bash, kimi-inspect; two facts merged into klient's) and leave 1-2-sentence pointers in the root map (17.7 KB -> 2.9 KB, root file 25.2 KB -> 10.3 KB). Also drops one stale fact: the root kimi-web entry referenced a pnpm dev:v1 script that no longer exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Three independent items:
coder agent started in background) never showed which model the subagent is bound to.Warning: Session wire protocol version 1.5 is newer than the current version 1.4. Records will be replayed without migration.AGENTS.mdgrew to 25 KB — pushing the merged AGENTS.md prompt context to 32.8 KB, past the engine's recommended 32 KB budget — mostly because## Project Mapentries became per-package essays (17.7 KB of the file).What changed
One commit per item:
feat(tui):BackgroundAgentMetadatagainsmodel, populated from thesubagent.spawnedevent's bound alias via the existingmodelDisplayNameresolution, and rendered in the headline —coder agent (GLM 5.2) started in background. v2-only (v1's spawned event carries no model; v1 entries render unchanged). +2 formatter tests.fix(agent-core): ports the engine-agnostic wire 1.4→1.5 migration from agent-core-v2 (backfills the goal wall-clock anchor from the record timestamp) into agent-core and bumpsAGENT_WIRE_PROTOCOL_VERSIONto'1.5', matching upstream v2. The 1.4→1.5 delta is one additive field, so v1 replay of v2-written sessions was already safe — this silences the warning and migrates genuine 1.4 files properly. +migration test (v2 suite's cases); the v1.4 test's snapshot now pins the literal1.4(the scrubber only masks the current version).docs:## Project Map17.7 KB → 2.9 KB (root file 25.2 KB → 10.3 KB). Detail moved, not deleted: newpackages/kap-server/AGENTS.md,packages/transcript/AGENTS.md,packages/minidb/AGENTS.md,packages/tree-sitter-bash/AGENTS.md,apps/kimi-inspect/AGENTS.md; two facts merged intopackages/klient/AGENTS.md. Root keeps 1–2-sentence pointers per package; all other root sections byte-identical. Also drops one stale fact (pnpm dev:v1script no longer exists).Verification
/bin/bashNixOS env failures, unrelated); records/migration suites 52/52tsc --noEmitclean in kimi-code and agent-coreNote: the condensed root
AGENTS.mdis an upstream-synced file — future upstream edits to Project Map entries may need conflict resolution against the pointer entries.