Conversation
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
|
This should be mergeable. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f108d70e92
ℹ️ 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".
| await Promise.race([ | ||
| kernelRun, | ||
| new Promise<void>((_resolve, reject) => { | ||
| timer = setTimeout(() => { | ||
| reject(new Error(`ExecuteCode timed out after ${timeoutMs}ms`)) |
There was a problem hiding this comment.
Terminate timed-out ExecuteCode runs
This timeout branch only rejects Promise.race and never stops the underlying kernelRun, so code can keep executing after the tool already returned a timeout error. Any script that outlives timeoutMs can still perform notebook mutations in the background, which makes the conversation state diverge from the reported failure.
Useful? React with 👍 / 👎.
| clientError.length > 0 | ||
| ? `Tool execution failed: ${clientError}` | ||
| : toOutputString(outputValue) |
There was a problem hiding this comment.
Preserve tool output when clientError is set
When clientError is present, this code replaces the tool result with a generic failure string and drops result.output. The new ExecuteCode flow returns partial stdout/stderr on failures (for example, timeout after initial logs), so discarding output here hides useful diagnostics from the follow-up model turn.
Useful? React with 👍 / 👎.
Summary
codeModeExecutorfor ExecuteCode tool callsresponsesDirectChatkitFetchto advertise and handle ExecuteCode function callsChatKitPanelWhy
Validation
pnpm exec vitest run src/lib/runtime/responsesDirectChatkitFetch.test.ts src/lib/runtime/codeModeExecutor.test.tspnpm exec vitest run src/components/ChatKit/ChatKitPanel.test.tsx