chore(examples): use built-in framework surface over hand-rolled setup - #473
Merged
Conversation
…lineage and useAgent() - src/api.ts: add useWorktree() over the runtime's useAgent(); the README no longer claims a hook contract is missing. - event routes: session/start, agent/start, tool/before, tool/after and stop take actor identity from (await agent()).lineage first, then the native agent_id/session_id pair, then the worktree binding, then the derived worktree:<root> fallback. Provenance now records the runtime lineage resolution (native | registry | inferred) alongside derived. - providers/agent-topology.ts: state the actual reason the snapshot is unavailable (providers receive no identity/lineage/state, #459). - README: fix the stale useWorktree()/lineage sentences; point at #457, #458, #459, #460 for what is still missing. - route-unit tests: cover lineage-carried agent/start and tool/before.
…col/server dependency The generated MCP server ships its own transport; no module in the example imports the SDK. Lockfile refreshed for the removed importer entry.
…types from public exports JsonObject/JsonValue come from the agent-bundle root export and DevRuntimeProvider from agent-bundle/api; both were reached through ../../../../packages/agent-bundle/src/dev before. The remaining deep imports (runtime-protocol, runtime-generation-store, runtime-mcp-registry, the rest of runtime-provider) have no public counterpart yet.
|
|
To use Codex here, create an environment for this repo. |
commit: |
This was referenced Sep 3, 2026
Owner
Author
|
The two framework gaps listed under "Proposed framework issues" are now filed:
|
This was referenced Sep 4, 2026
Merged
Merged
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.
Fixes #51, #52 and #54 (daemon side; the client-side
MAKEFLAGStransport item in #54 is handled separately).#51 — kill honoured while parked; batch, ETA and settlement hardening
processJobnow races the job's kill signal against the load gate +admission.withPermits(1). A kill on a job parked at the gate or on the permit settles itkilled(killed while queued) immediately via the existingfinishKilledBeforeRunpath, releases any heavy claim, and no longer blocks the rest of its lane. A kill that lands afterclaimStartis left to the executor (the race arm parks instead of interrupting an admitted run).foldBatchskips candidates whose state is notqueued;processLaneJobre-checks state before the batch window sleep and before folding, so a kill-requested head neither waits for nor leads a batch.remainingEstimateMs(clamped at 0) and counts a head parked at the gate (newLane.head, set from take to settlement). The existing assertion indaemon-broker.test.tsthat encoded the negative-cancel bug (waitEtaMs === 0) now expects the queued job's estimate.settleJobisolates every step afterclaimSettlement(markFinished, metrics,notifyWaiters,completeExit,settleAttachments) withsettlementStep(log + continue on defect).settleAttachmentsandfinishAttachmentapply the same per-step isolation.#52 — attachment registration races
replayThenGoLivetakes the replay snapshot and clearspendingLivein oneEffect.sync, so a chunk emitted between registration and replay is delivered once.completeAttachRegistrationre-checksleader.attachments.get(ticket) === attachmentin a sync frame before any ledger write and returns early if the leader settled / the attachment was killed or released in the window.updateRunning/updateAttachedcarryAND status NOT IN (<terminal>)and record a transition only when a row changed.releaseSatisfiedAttachments) is guarded: a ledger/metric defect is logged instead of surfacing aspump-failedand terminating cargo.mergeStderris part of identity/coverage attach compatibility for raw-output leaders (channelsCompatible); demux runs never merge so the flag is irrelevant there. Batch folding is documented as unchanged (folded followers receive the composite's channels as produced).#54 — jobserver vs
CARGO_BUILD_JOBSisSharedJobserverArmed();cargoExecEnvinjectsCARGO_BUILD_JOBSonly when the FIFO is not armed, so an armed daemon letssharedJobserverDeltainjectMAKEFLAGSand cargo joins the shared budget. Caller-j/CARGO_BUILD_JOBSstill win.CARGO_HAULER_JOBS_GRANTenv row state the precedence;DaemonConfigShape.jobsGrantdoc updated.Tests (each written failing first, then fixed)
tests/daemon-races.test.ts(new, in-process broker over the fake cargo via the sharedtests/broker-fixture.ts, extracted fromdaemon-async.test.ts):killedwithin the await budget while the holder keeps runningmarkFinisheddiesmarkAttacheddelayed 400 msmarkAttachedis held until after the leader settled staysdonemarkFinishedleaves the leaderdone(notpump failed) and still delivers the follower's exitcargo testrequires equalmergeStderrtests/daemon-ledger.test.ts: latemarkAttached/markRunningnever reopen adonerow or add transitions.tests/daemon-jobs-grant.test.ts(new):cargoExecEnvmatrix + a daemon spawn assertingCARGO_BUILD_JOBSunset andMAKEFLAGScarrying--jobserver-auth=fifo:<stateDir>/jobserver.fifo.Gate
pnpm checkgreen locally: validate, build, typecheck, Effect diagnostics (pre-existing suggestions only), rstest 637 passed / 0 failed, route-unit 32 passed / 0 failed.Review status
(filled in per AGENTS.md once the automated review runs)