feat(interface): add child-task stream event and environment creation verdict - #231
Merged
Merged
Conversation
tangletools
approved these changes
Aug 21, 2026
tangletools
left a comment
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — 3cc0ece1
This PR was opened by the trusted drewstone account.
This approval is provisional and was applied by the local stand-in because the pr-reviewer webhook host is unreachable (2026-08-21). CI on this head is fully green. The full PR reviewer audit re-runs via the resweep when the service returns and will publish findings if it detects issues.
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.
Why
StreamEventunion has no child-task lifecycle event, so provider-native subagents (Claude Code, OpenCode, Codex) cannot reach clients without runner-specific parsing.AgentEnvironmentProvider.creategives the caller no way to prove whether the call provisioned the environment or replayed an existing one, so a failed follow-up cannot decide whether destroy is safe.What
child-taskstream event (packages/agent-interface/src/stream-events.ts): stablechildId, optionalparentChildId, status (started|running|completed|failed|cancelled), title,time{started,updated,ended?}, runner, model,usage(sharedTokenUsage),terminalReason,sourceEventIdfor replay dedupe, and a bounded opaqueraw. Identity never depends onraw; a provider without a stablechildIdemits no event. The docs comment carries a dedupe-by-sourceEventIdexample.z.strictObjectmember inCanonicalStreamEventSchema(src/runtime-control.ts) with certainty refinements:time.ended/terminalReasononly with a terminal status, update/end times never precede start, no self-parent.AgentEnvironment.creation?: "created" | "replayed"+AgentEnvironmentCreationSchema(src/environment-runtime.ts).createAgentEnvironmentWithIdempotencynow returns areplayedAgentEnvironmentView(shared members,creation: "replayed") for every same-key call after the first, including callers that awaited the same pending create. Absent means unknown; consumers fail closed and never destroy what they cannot prove they created.created→created,idempotent_replay→replayed,unknown/absent → absent) via a new optionalSandboxInstanceLike.createReceipt?().createdon the call that builds the environment handle; aget()reconstruction states nothing. (The bridgePOST /v1/sessionshappens at dispatch, not create, so create-time truth is the handle provisioning.)created.Proof
pnpm build: all 10 packages Done.pnpm check-types: 0 errors.pnpm test: 1519 passed, 0 failed — interface 455 (+4), testkit 26 (+2), cli-bridge 199, tangle 146 (+1), core 505, trace-contract 182, e2b/daytona/computesdk 2 each.pnpm check:package-artifacts: 9 isolated packages, 31 exports, 62 export targets.pnpm check:control-artifacts: packed cohort 7 test files, 141 tests passed (+4).runtime-control.test.tschild-task accept/reject matrix (15 reject cases),RuntimeEventEnveloperound-trip, live-vs-replay dedupe tree equality;environment-provider.test.tsreplayed-view semantics, pending-coalesce view, class-instance refusal, creation schema; tangle receipt mapping (5 variants); cli-bridge created/absent-on-get; testkit per-call verdict + replay-claims-created rejection.Changesets:
@tangle-network/agent-interfaceminor (1.4.0);@tangle-network/agent-provider-tangle,@tangle-network/agent-provider-cli-bridge,@tangle-network/agent-provider-testkitpatch.Refs tangle-network/agent-runtime#756
Refs tangle-network/agent-runtime#799