Repository navigation
fix(deferred): persist activated tools across session resume and durable runs - #5125
iemafzalhassan wants to merge 2 commits into
Conversation
|
👋 Some commits in this PR are not signed and verified by GitHub. Please sign your commits with a GPG or SSH key registered in your GitHub account, then force-push. Commits that are not verified: See GitHub’s guide on signing commits for setup instructions. I’ve added |
…ble runs Introduce a tools.Stateful capability backed by existing Session.Attributes and DurableRuntime checkpoints so add_tool activations survive process restarts and mid-run continuation without adding dedicated accessors to session.Session. Closes docker#5056 Signed-off-by: iemafzalhassan <iemafzalhassan@gmail.com>
d9d5b6c to
837fcdc
Compare
aheritier
left a comment
There was a problem hiding this comment.
7 blocking issues inline: durable runs can lose activations or session metadata, and restore can mix state across sessions, start from the wrong branch state, select a different tool, or stall a resumed turn. Thanks for adding the SQLite and suspend/resume tests; the inline notes call out the cases they still need to cover.
… checkpoints - Scope Stateful snapshots and deferred activations per session via tools.StateScope - Persist source identities in deferred snapshots and keep delayed original sources pending - Avoid eager source listing in RestoreState and bound relevant deferred discovery - Checkpoint toolset state at CallRecorded and persist final state before EndRun in settle - Leave unrelated session attributes intact on pre-change v1 checkpoints - Reconcile toolset state attributes at branch/fork points in session.BranchSession and ForkSession - Fix golangci-lint embeddedstructfieldcheck and inamedparam issues Signed-off-by: iemafzalhassan <iemafzalhassan@gmail.com>
|
@aheritier Thanks for catching those. I pushed 259035b to address all seven inline items and the two lint failures. Toolset state is now scoped per session via I also added the requested regression tests in |
Closes #5056
Persist
deferred.ToolSetactivations across session resumes andDurableRuntimecheckpoints without adding dedicated fields or accessors tosession.Session.Summary of changes
tools.Statefulcapability interface (StateKey,SnapshotState,RestoreState) inpkg/tools/stateful.go.tools.Statefulondeferred.ToolSetinpkg/tools/builtin/deferred/deferred.go, encoding sorted activated tool names as JSON and keeping not-yet-listed names inpendingRestoreuntil delayed sources finish starting and list their tools.session.Session.Attributes(docker-agent.toolset.<agent>.<key>) inpkg/runtime/toolset_state.go, wired intorunStreamLoop,EmitStartupInfo, and ACPreconnectSession.Session.AttributesinDurableRuntimecheckpoints (pkg/runtime/durable.go) and flush stateful toolset snapshots duringCallFinished, soContinueStreamrestores mid-batch and between-turn activations cleanly.DurableRuntimesuspend/resume (including mid-batch interruption).Verification
go test -v -race ./pkg/tools ./pkg/tools/builtin/deferredgo test -v -race ./pkg/runtime -run "TestLocalRuntime_DeferredTools|TestLocalRuntime_Stateful|TestDurableRuntime_DeferredTools"go test ./pkg/session/... ./pkg/runtime/... ./pkg/acp ./pkg/teamloader/... ./pkg/app/... ./pkg/server/...go run ./lint .(3197 file(s) inspected, no offenses detected)go vet ./...gofmt -s -lclean across all modified and added files