Skip to content

feat: background-agent model display, v1 wire 1.5 support, AGENTS.md map trim - #21

Merged
zicochaos merged 3 commits into
mainfrom
feat/bg-agent-model-wire-15-docs-trim
Jul 29, 2026
Merged

feat: background-agent model display, v1 wire 1.5 support, AGENTS.md map trim#21
zicochaos merged 3 commits into
mainfrom
feat/bg-agent-model-wire-15-docs-trim

Conversation

@zicochaos

Copy link
Copy Markdown
Owner

Problem

Three independent items:

  1. Background subagent entries (coder agent started in background) never showed which model the subagent is bound to.
  2. Resuming a v2-written session (wire protocol 1.5) in the default v1 TUI printed: Warning: Session wire protocol version 1.5 is newer than the current version 1.4. Records will be replayed without migration.
  3. The root AGENTS.md grew 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 Map entries became per-package essays (17.7 KB of the file).

What changed

One commit per item:

  • feat(tui): BackgroundAgentMetadata gains model, populated from the subagent.spawned event's bound alias via the existing modelDisplayName resolution, 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 bumps AGENT_WIRE_PROTOCOL_VERSION to '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 literal 1.4 (the scrubber only masks the current version).
  • docs: ## Project Map 17.7 KB → 2.9 KB (root file 25.2 KB → 10.3 KB). Detail moved, not deleted: new packages/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 into packages/klient/AGENTS.md. Root keeps 1–2-sentence pointers per package; all other root sections byte-identical. Also drops one stale fact (pnpm dev:v1 script no longer exists).

Verification

  • TUI: 2488 passed; agent-core: 4139 passed (4 pre-existing /bin/bash NixOS env failures, unrelated); records/migration suites 52/52
  • oxlint clean on touched files; tsc --noEmit clean in kimi-code and agent-core
  • Root diff confined to a single Project Map hunk; 20 distinctive tokens from the moved prose spot-checked to resolve in exactly one package file each

Note: the condensed root AGENTS.md is an upstream-synced file — future upstream edits to Project Map entries may need conflict resolution against the pointer entries.

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.
@zicochaos
zicochaos merged commit a6a96a0 into main Jul 29, 2026
13 of 14 checks passed
@zicochaos
zicochaos deleted the feat/bg-agent-model-wire-15-docs-trim branch July 30, 2026 12:40
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