(WIP) feat: pause/resume runtime, run store, useChat#5
Open
marslavish wants to merge 6 commits intofeat/features-completefrom
Open
(WIP) feat: pause/resume runtime, run store, useChat#5marslavish wants to merge 6 commits intofeat/features-completefrom
marslavish wants to merge 6 commits intofeat/features-completefrom
Conversation
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.
Pause/Resume Agent Runtime + React Bindings
Implements the test infrastructure and pause/resume runtime defined in ROADMAP.md. The single architectural change: the agent loop becomes checkpoint-able. Tools may declare a
decisionJSON Schema; when the loop hits one, it persists run state, emits atool_decision_pendingevent, and waits foragent.resume(runId, decision)before continuing.Phase 0 — Test Infrastructure (must)
*.live.test.ts; one env per package (jsdom only in@agentic-kit/react)tools/test/withcreateScriptedProvider,createScriptedSSEResponse,parseSSEStream, fixtures; existing tests migratedpackages/agent/__tests__/sse.test.tscovers split chunks, multi-linedata:, comments, event-type framing, mid-event aborttests/integration/scaffolded; first tests land with 1.1 / 1.3 over real HTTPrunRunStoreContractTests— portable contract suite for anyRunStoreimplementationPhase 1 — Pause/Resume + React Bindings (must)
decisionschema onAgentTool;tool_decision_pendingevent;agent.resume(runId, decision); reusesvalidateSchemafor the decision payloadRunStoreinterface +MemoryRunStoredefault; consumer supplies Redis / KV / DB backend in productionAgentRunHandlewithevents(),toReadableStream(),toResponse(); canonical SSE wire format onContent-Type: text/event-stream@agentic-kit/react— new package;useChathook withsend,respondWithDecision,abort, lifecycle callbacks (onMessage,onFinish,onDecisionPending)Phase 2 — Production Polish (should)
cache?: 'short' | 'long'flag, per-provider translation (Anthropiccache_control, OpenAI native hint, Ollama silent ignore)Phase 3 — Optional Extensions (could)
runId,Last-Event-IDsemanticsruns: 'client'flag for browser-only capabilities (deferred until a real use case appears)Out of scope
See ROADMAP.md § Non-Goals: conversation-history persistence,
generateObjectanalog, schema-library coupling, framework-specific helpers, UI components, embeddings as primary capability, prompt-construction utilities, conversation modes, production storage backends.Open questions
RunStoreships)runRunStoreContractTestscoverage for discriminated-union /oneOfdecision schemasagent_resumeevent vs. redocumentingagent_startas "loop entry"useChatauto-routing onrespondWithDecisionSee ROADMAP.md § Open Questions.