fix(peers): adopt canonical profile contracts - #373
Conversation
tangletools
left a comment
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — ddfecb51
This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: drewstone_author · 2026-08-03T05:08:08Z
tangletools
left a comment
There was a problem hiding this comment.
🟢 Value Audit — sound
| Verdict | sound |
| Concerns | 0 (none) |
| Heuristic | 0.0s |
| Duplication | 0.0s |
| Interrogation | 180.7s (2 bridge agents) |
| Total | 180.7s |
💰 Value — sound
Removes local harness-extras and interaction-field-widening shims now that agent-interface 0.43 carries them canonically — a clean, in-grain de-duplication.
- What it does: Two de-duplications, both enabled by bumping agent-interface 0.40→0.43. (1) harness/index.ts: drops the EXTRA_HARNESSES=['forge','cursor'] list, its compile-time adoption guard, the canonicalHarness() indirection, and the canonical/non-canonical branching in isModelCompatibleWithHarness/snapModelToHarness/snapHarnessToModel — Harness becomes a plain Exclude<HarnessType, NON_BACKEND_HARNESSES> and
- Goals it achieves: Kill the fork: agent-app held a second harness taxonomy (canonical + extras) and a second field schema (canonical + widened) purely because the pinned agent-interface predates those values. Once 0.43 ships forge/cursor in the enum and allowCustom/maxLength on the field schema, the local copies become drift risk — a harness added upstream would need an edit here, and a field flag the schema adds wo
- Assessment: Coherent and in the grain. The removed code existed for exactly one reason — the pinned peer lacked the values — and the diffs delete precisely that reason's machinery (the extras list, the guard, the canonicalHarness mapper, the widened field unions, the raw-return workaround) and nothing else. parseInteractionRequest moving from
return request as InteractionRequestWireto `return validation.da - Better / existing approach: none — this is the right approach. Searched src/ for AgentProfile local copies (none — it's imported from agent-interface throughout), for residual EXTRA_HARNESSES/canonicalHarness references (none), and for other interaction-field or harness-taxonomy duplications (chat-react re-exports HarnessType from sandbox-ui's picker, which is a different surface — the UI enum — and correctly stays separate)
- Model: opencode/zai-coding-plan/glm-5.2
- Bridge attempts: 2
- Bridge warning: opencode/kimi-for-coding/k2p7: opencode: opencode error
🎯 Usefulness — sound
Replaces agent-app's local interaction-field widening and harness-extras workarounds with the canonical agent-interface 0.43 contracts now that the upstream schema defines them, and aligns the peer cohort.
- Integration: Fully wired. The changed types (ChatInteractionField, InteractionRequestWire, parseInteractionRequest) are consumed by 6+ downstream modules — web-react/interaction-card-support.ts:55, web-react/chat-stream.ts:208, chat-store/parts.ts:205, chat-routes/sandbox-producer.ts:613, interactions/route.ts:143, interactions/sidecar.ts:105. tsc --noEmit is clean. The harness functions (snapHarnessToModel, i
- Fit with existing patterns: Exactly the codebase's stated grain. AGENTS.md invariant 6: 'Reuse the engine primitive; never hand-roll one the engine already gives you.' The local field widening (allowCustom/maxLength appended to InteractionField) and EXTRA_HARNESSES (forge/cursor held outside the canonical enum with a compile-time guard meant to force exactly this edit) were workarounds for a canonical contract that predates
- Real-world viability: Holds on and off the happy path. The parseInteractionRequest change is safer under edge inputs: a malformed-but-object-shaped request now cannot slip through as a raw cast. The harness simplification removes the canonicalHarness() indirection that short-circuited compatibility for non-canonical ids; since forge/cursor are now canonical, harnessSupportsModel governs them like every other harness —
- Model: opencode/zai-coding-plan/glm-5.2
- Bridge attempts: 1
No concerns — sound change, no better or existing approach found. ✅
What this audit checks
It judges the change on its merits — not whether it was tasked out in an issue. Unticketed, fast-moving work is fine; the question is whether the change is good and whether a better or existing approach should be used instead.
| Pass | What it asks |
|---|---|
| Heuristic | Vague title? Whitespace-only or cruft-bearing diff? (content signals only) |
| Duplication | Do added function/class names already exist elsewhere in the repo? |
| Value Audit | What does it do? What goal does it achieve? Is it good? Better architecture or already-exists? |
| Usefulness Audit | Does it integrate and fit? Will it hold up in real use and actually get used? |
Findings are concerns, not blocks — the human reviewer decides what to do with them.
Summary
agent-interface0.43 valuesWhy
Discovery changes complete
AgentProfilevalues. Agent App must consume that shared contract directly so profiles do not fork into app-local shapes or silently lose model configuration.Proof
pnpm run typecheckNODE_OPTIONS=--max-old-space-size=12288 pnpm run buildpnpm run kniporigin/main