feat(runtime): compose steerable provider sessions - #662
Conversation
0558aae to
d046ca7
Compare
tangletools
left a comment
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — d046ca71
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-01T00:28:10Z
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 | 86.6s (2 bridge agents) |
| Total | 86.6s |
💰 Value — error
value agent produced no parseable value-audit JSON.
- Model: opencode/deepseek/deepseek-v4-pro
- Bridge attempts: 3
- Bridge error: opencode/kimi-for-coding/k2p7: bridge stream ended without value-audit content; opencode/zai-coding-plan/glm-5.2: Bridge returned 503: {"error":{"message":"cli-bridge admission timed out after 30000ms","type":"admission_rejected","reason":"queue_timeout","admission":{"active":20,"queued":4,"maxActive":20,"maxQueue":48}}}; opencode/deepseek/deepseek-v4-pro: Bridge returned 503: {"error":{"message":
🎯 Usefulness — sound
Opt-in provider steering composes the existing steerable sandbox session loop through the existing SandboxClient adapter — no new loop, fail-loud preconditions, plus a real reasoning-token usage fix.
- Integration: Reachable through the public
createExecutor({ backend: 'provider', provider, steering })branch (src/runtime/supervise/runtime.ts:1667).createExecutoris the single built-in factory, registered in the executor registry (runtime.ts:1752) and consumed throughout the runtime. The new branch reusesproviderAsSandboxClient(environment-provider.ts:187) andsandboxExecutor's steering mode (runt - Fit with existing patterns: Fits the established grain precisely.
createExecutoris explicitly 'backend as data' (runtime.ts:1622), and theproviderbackend already had a one-shot path viaproviderAsExecutor. The sandbox-session.ts header (lines 11-22) states the design goal: ONE steerable session shape shared across runtimes (sandbox + cli-bridge). This extends that same shape to providers by adapting the provider to - Real-world viability: Error paths are handled and tested. Pre-creation capability gate checks
streaming.live+sessions.continuebefore any environment is made (environment-provider.ts:212-219); post-creationsession()absence triggers destroy-then-throw (environment-provider.ts:221-226, tested at environment-provider.test.ts:527). Harness conflicts and missing harness throw before probing/creating (runtime.ts:17 - 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
createSteerableSandboxSession; the low-level one-shot provider executor is unchanged.AgentProfile.harnessand fails loudly on a missing harness or a conflictingAgentSpec.harness/ provider default backend — no silent backend fallback.AgentSession.cancel(), and provider-specific stream/cancel failures become the existing interrupt signal so a forced steer can re-plan.AgentProfileidentity, provider options, normalized events, usage fields, live progress, and trace data survive the adapter boundary; the one-shot executor path keeps provider-owned backend defaults.environment.session()— before this mode creates an environment.No new agent loop or provider-specific coordinator is introduced.
Proof
environment-provider.test.ts,sandbox-events.test.ts)git merge-tree --write-tree origin/main HEAD: cleanRetained risk
The package has no configured third-party environment provider, so the live network-provider check remains an integration responsibility; the PR proves the public Interface 0.39 contract with exact provider events and session controls.
@tangle-network/agent-provider-cli-bridge@0.2.33advertises continuation but does not exposeenvironment.session(), so this mode rejects it before creation.@tangle-network/agent-provider-tangle@0.4.5exposes the required session controls; adding them to the CLI-bridge provider is a separate upstream change.