Skip to content

fix(peers): adopt canonical profile contracts - #373

Merged
drewstone merged 3 commits into
mainfrom
fix/interface-042-peer-20260802
Aug 3, 2026
Merged

fix(peers): adopt canonical profile contracts#373
drewstone merged 3 commits into
mainfrom
fix/interface-042-peer-20260802

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

Summary

  • replace Agent App's local profile and question contract copies with the canonical agent-interface 0.43 values
  • preserve deep immutability while converting profile configuration into App execution options
  • align the current shared package cohort and require the public Runtime 0.123.1 model-routing fix in the package and both generated-project templates
  • refresh generated API documentation and dependency locks

Why

Discovery changes complete AgentProfile values. 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 typecheck
  • incident tests: 293/293 passed
  • full tests: 3,999/3,999 passed; 13 skipped
  • NODE_OPTIONS=--max-old-space-size=12288 pnpm run build
  • clean default project: typecheck, 4/4 tests, Cloudflare dry run
  • clean chat project: typecheck, 5/5 tests, Cloudflare dry run
  • pnpm run knip
  • clean merge computation against current origin/main

@tangletools tangletools 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.

✅ 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 tangletools 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.

🟢 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 InteractionRequestWire to `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.

value-audit · 20260803T051130Z

@drewstone
drewstone merged commit 8dcaf9f into main Aug 3, 2026
1 check passed
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.

2 participants