Repository navigation
fix: initialize native Hermes chat instructions before delivery (AXI-112) - #58
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20d50242d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!canvasSummary) return `${baseSystemPrompt}\n\n${storyboardHint}`; | ||
| return `${baseSystemPrompt}\n\n${canvasSummary}\n\n${storyboardHint}`; | ||
| }; | ||
| const systemPrompt = await buildSystemPrompt(); |
There was a problem hiding this comment.
Skip prompt building for dispatch-only turns
When this request is for a dispatch-backed agent, the route returns at the useDispatch branch without ever using systemPrompt, but this new unconditional await buildSystemPrompt() still runs first. If the operator is chatting from a canvas, that calls loadCanvasContextSummary() (which reads the canvas nodes/shapes) before the user message is queued, so local/daemon dispatch chats now pay unnecessary canvas-summary work and can fail before dispatching even though the prompt is unused. Please gate this initialization to Hermes/server-streaming paths or move it after the dispatch early return.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fix
The authenticated v0.26.0 production smoke exposed a native Sessions-only temporal-dead-zone failure: the durable ConnectorDelivery transaction serialized
systemPromptbefore that block-scoped value was initialized later in the route.This prepares the base/canvas-aware instructions before the atomic user-message/outbox transaction, then reuses them for provider history.
/v1/runsremains unchanged.Validation
Implements AXI-112.