refactor(harness): source harness↔model compatibility from @tangle-network/agent-interface#153
Merged
Conversation
…twork/agent-interface Delete agent-app's hand-rolled compatibility/snapping fork; delegate to the canonical helpers so the shell guard, the sandbox-ui pickers, and the cli-bridge backends read one policy. - isModelCompatibleWithHarness / snapModelToHarness / snapHarnessToModel / assertHarnessModelCompatible / modelProvider now delegate to agent-interface. agent-app's Harness taxonomy is a superset of agent-interface's HarnessType (forge/cursor), so the calls cast 'as HarnessType' — safe because those extra runners are router-backed (no provider lock) there. - remove the duplicated HARNESS_MODEL_POLICIES / PROVIDER_PREFERRED_HARNESS / HarnessModelPolicy (no consumer imports them); keep the harness taxonomy + session-lock invariant here. - add @tangle-network/agent-interface as a required peer (+ dev) dep, >=0.15.0. Part of the harness/model/effort selector unification (tangle-network/gtm-agent#395).
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.
What
Deletes agent-app's hand-rolled harness↔model compatibility/snapping fork in
src/harness/index.tsand delegates to@tangle-network/agent-interface— the single source oftruth shared with the sandbox-ui pickers and the cli-bridge backends.
Changes
isModelCompatibleWithHarness,snapModelToHarness,snapHarnessToModel,assertHarnessModelCompatible,modelProvidernow delegate to agent-interface (same namesand signatures, so the call sites in
src/sandbox/index.tsandsrc/web-react/...are untouched).HARNESS_MODEL_POLICIES,PROVIDER_PREFERRED_HARNESS, and theHarnessModelPolicyinterface. Confirmed nothing outside this file (in any repo) imports them.Harnesstaxonomy (KNOWN_HARNESSES,isHarness,coerceHarness,DEFAULT_HARNESS) and theresolveSessionHarnesssession-lockinvariant.
@tangle-network/agent-interfaceas a required peer dep (+ dev),>=0.15.0.The one seam:
as HarnessTypeagent-app's
Harnessis a superset of agent-interface'sHarnessType— it carriesforge/cursor, which agent-interface doesn't list (and omitsnanoclaw/gemini/aliases). Thedelegations cast
harness as HarnessType. This is safe: those agent-app-only runners have noprovider lock in agent-interface, so they resolve as router-backed (any model) — the correct
behavior — and the snap helpers only ever return a vendor-locked harness or
opencode, all validHarnessvalues. Full harness-taxonomy unification (so the cast can go away) is a deliberatefollow-up, not part of this PR.
Why
The harness↔model rule was hand-copied into three diverging places (agent-interface, sandbox-ui,
and this fork). agent-interface is now the source (tangle-network/agent-sdk#8, published as
agent-interface@0.15.0); this makes agent-app import it so the policy can't drift — and thenanoclawcorrection (router-backed) flows from one place.Verification (against published
agent-interface@0.15.0)pnpm typecheck— clean (the casts type-check; nothing references the removed symbols).vitest run src/harness/index.test.ts— 12/12 pass (compat, snap,assertthrow, session lock).vitest run src/sandbox/index.test.ts— the harness-lifecycle cases (deletes and recreates on harness mismatch,driveSandboxTurn) pass. The only 3 failures are pre-existing andenvironment-specific (deferred-file tests that shell out and hit a local
.bash_profileerror —unrelated to this change).
Notes
chore(release)flow's job. A release is needed sogtm-agent can bump to an agent-app that carries this.
agent-sdk#8 (merged + published), sandbox-ui#142 (draft), then gtm-agent dep bumps.
Draft until released and validated downstream.