ref(chat): Replace reply-generator slots with AgentRunner#751
Merged
Conversation
Introduce a small consumer-owned AgentRunner interface for the runtime paths that previously accepted reply-generator injection slots. Wire it through the Slack reply executor, Slack resume, local runner, agent dispatch, continuation, handlers, and CLI composition roots. Keep the minimal AgentRunOutcome contract from #750 while preserving sandbox trace propagation precedence and requiring concrete runner dependencies instead of silent production fallbacks. Cherry-picked from 3a826ac and resolved onto #750. Refs #746 Co-Authored-By: GPT-5.5 Codex <noreply@openai.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Co-Authored-By: GPT-5 Codex <noreply@openai.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Root typecheck previously ran a hand-maintained package list that excluded @sentry/junior-evals, and CI never ran typecheck at all, so type breaks in the eval harness landed silently. Switch the root script to a recursive pnpm run so any package that defines typecheck is covered automatically, give junior-evals a typecheck script, and add the step to the CI workflow. Refs #746 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The eval harness still injected the removed reply-generator slots: replyExecutor.generateAssistantReply was silently ignored (evals would call the real Pi model instead of scripted replies), and the Slack continuation and scheduled-dispatch paths crashed on an undefined agentRunner. Provide the mock as replyExecutor.agentRunner and thread one AgentRunner through processEvents to both call sites. The scripted mock branches also predate #750: they returned raw AssistantReply objects where the executor now expects an AgentRunOutcome, so wrap them with completedAgentRun. Refs #746 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The production runner was constructed independently in app.ts, production.ts, and the services fallback, so the three sites could silently diverge. Build it once in createApp, inject it through runtimeServiceOverrides.replyExecutor.agentRunner, and make createProductionConversationWorkOptions require the runner instead of silently constructing its own. Also remove the parallel tracePropagation channel from the agent-dispatch handler and runner deps: the runner wrapper owns that default, and the explicit context write made the wrapper's option dead code on the dispatch path. Refs #746 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add a shared tests fixture exporting the respond-backed harness runner and a never-run guard runner, replacing four hand-rolled stubs and two copy-pasted inline runners in the OAuth callback harnesses. The harnesses now accept an injected agentRunner, so the Slack callback integration tests inject their reply mock at the runner seam instead of module-mocking @/chat/respond. Also extract the duplicated local-turn setup in the chat CLI into one helper, and skip the context-rewriting wrapper in createAgentRunner when no trace propagation default is configured. Refs #746 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
createProductionConversationWorkOptions required an agentRunner but only used it for the resume path, while the reply runtime still resolved its runner from the services overrides; a caller supplying mismatched values would silently run replies and resumes on different runners. Fold the explicit runner into the services passed to createSlackRuntime so one channel owns it. Refs #746 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dcramer
added a commit
that referenced
this pull request
Jul 4, 2026
) `ReplyRequestContext` was a flat ~35-field bag where nearly every field was optional, so the type could not express which combinations were valid and call sites gave no hint of a field's role. The request is now grouped into `input`, `routing`, `policy`, `state`, `observers`, and `durability` sub-objects, and `AgentRunner.run` takes the single grouped request (`messageText` now lives in `input`). No behavior change and no field optionality changes: every flat field maps 1:1 into exactly one group, runtime destination/requester invariant checks are unchanged, and the outcome contract from #750/#751 (`suspended` status, deferred pause handlers, `resumeVersion`) is untouched. The executor body still operates on the historical flat shape via a private `flattenReplyRequestContext` step; consuming the groups directly is deferred to the #746 Phase 5 decomposition. This ports the remaining regrouping commit from #748 onto the reworked outcome model. Review order: start with the group interfaces and flatten step in `src/chat/respond.ts`, then the six call-site regroupings (`runtime/reply-executor.ts`, `runtime/slack-resume.ts`, `agent-dispatch/runner.ts`, `local/runner.ts`, `runtime/agent-continue-runner.ts`, the oauth handlers). The 36 test-file changes are mechanical regroupings of existing assertions — no tests added, removed, or weakened — with a shared `flattenReplyRequestForTest` fixture replacing per-file copies of the flatten shim. Refs #746 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: GPT-5.5 Codex <noreply@openai.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
The chat runtime now passes agent execution through a small
AgentRunnerinterface instead of handing around the full reply-generator function signature. Slack replies, Slack resumes, local turns, durable dispatch, continuation, handlers, and CLI composition roots all receive an explicit runner dependency.This pulls the second commit from #748 onto
mainafter #750. The conflict resolution keeps #750's minimal three-statusAgentRunOutcomecontract, preserves sandbox trace propagation precedence increateAgentRunner, and removes silent production fallback paths so queue and worker code use the runner wired by their composition boundary.Refs #746