fix(cli): restore question tool availability in code mode#9869
Conversation
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Files Reviewed (5 files)
Fix these issues in Kilo Cloud Reviewed by gpt-5.5-20260423 · 684,608 tokens |
| export async function write(p: string, content: string | Buffer | Uint8Array, mode?: number): Promise<void> { | ||
| try { | ||
| // kilocode_change start - atomic write via temp-file + rename to avoid partial reads on concurrent saves | ||
| const tmp = `${p}.${process.pid}.${Date.now()}.tmp` |
There was a problem hiding this comment.
WARNING: Temp file names can collide during concurrent writes
This temp path only uses the target path, process id, and millisecond timestamp. Two writes to the same file from the same process in the same millisecond will share tmp; one write can overwrite the other's temp content, and the second rename can fail with ENOENT after the first rename moves the shared temp file. Since this helper is meant to make concurrent saves safer, add a unique component such as a random suffix or monotonic counter.
There was a problem hiding this comment.
We have existing ENOENT issues so if this is true we should fix it
Resolve #9856
Resolve #9823
Summary
When the
buildagent was renamed tocodeinpatchAgents(), the permission ruleset was being rebuilt from scratch using onlydefaults(which deniesquestion) plussemantic_search: "allow". This discarded thequestion: "allow",suggest: "allow", andplan_enter: "allow"that the original build agent had, causing thequestionandask_followup_questiontools to be denied in code mode.The fix merges
agents.build.permissioninto the new permission set so all original allows are preserved before adding the Kilo-specificsemantic_search: "allow".