Repository navigation
feat(coderd/x/chatd): add include_tool_calls to wait_agent - #53
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc17b34630
ℹ️ 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".
…hats' into mike/todo-transcripts-8-wait-agent-tool-calls
…times, trim chat_id
@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". |
…-7-search-chats # Conflicts: # coderd/x/chatd/fork_chat_todos_internal_test.go # coderd/x/chatd/fork_tools.go
…hats' into mike/todo-transcripts-8-wait-agent-tool-calls
… tool calls truncateToolCallJSON duplicated truncateTranscriptJSON from the read_chat_transcript tool apart from its fixed size limit.
@codex review |
|
Codex Review: Didn't find any major issues. Swish! 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". |
…-8-wait-agent-tool-calls # Conflicts: # coderd/x/chatd/ARCHITECTURE.md # coderd/x/chatd/fork_tools.go
Merged at 7d5df06 after these checks:
|
Part of #10. Stacked on #52 (
search_chats).Adds an
include_tool_callsoption towait_agent(PRD R5.5): with it set to N, the result also carries the child's last N tool calls, so a parent can see what a child that timed out is doing, or how it reached its report. Behindfork-chat-todos. With the flag off,wait_agentis the upstream tool, schema included.subagent.go:appendForkToolswraps thewait_agenttool (root and nested) inforkWaitAgentTool, which adds the parameter to the schema, validates it (0 to 20), runs the upstream tool unchanged (it ignores the extra field) and addstool_callsto its JSON result. Error results are returned as they are, so a chat that is not a child gets no tool calls.tool_name,args,result(once there is one),is_errorandcreated_at(the part's emit time, else the message time), oldest first. A result settles only the newest call with its ID, since providers can reuse call IDs.chat_idis parsed with the upstreamparseSubagentToolChatID. Args and results are cut withchatloop.TruncateToolResultTextat 2 KiB; a cut value becomes a JSON string because a cut JSON value is not valid.httpmw.UserRBACSubjectanddbauthz.As), never as chatd. Onlybothvisibility rows are used (the query already drops model-only rows; user-only projections are skipped), and they go throughdb2sdk.ChatMessage, which appliesStripInternal. One call scans at most 200 rows.ARCHITECTURE.md: the fork TODO line now names the option.Validation:
TestWaitAgentIncludeToolCallspasses against Postgres 17 with the store wrapped indbauthz: the schema keepschat_idand addsinclude_tool_calls; a chat ID with a leading space works; the last 2 calls come back oldest first with paired results andis_error, a pending call has no result, an older call that reuses a later call's ID gets no result, an emit time is kept, long args are truncated, a user-only call and provider metadata are absent; without the option there are no tool calls; out-of-range and non-integer values and a chat that is not a child are errors. Negative controls that drop the visibility check,is_error, the result removal, the emit time or thechat_idtrim each fail the test../coderd/x/chatd/...passes;go vetis clean.UAT on a dev instance with a local model (fc17b34; the later commits only answer review), from chats owned by a plain member: a root spawned a general child that made 20 parallel todo tool calls, then called
wait_agentwithinclude_tool_calls: 3. The result carried the report and the child's calls 18, 19 and 20 in order, each with the result of its own call ID (checked in the database).