Repository navigation
Close the thread_stop/thread_archive approval bypass - #1598
Conversation
…#1432) Omitting fromThreadId treated the caller as self and skipped the human gate. Bind threadId on the MCP URL and use that as the caller. Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe8e2806a2
ℹ️ 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".
| } else if (args.fromThreadId && String(args.fromThreadId) === String(thread.id)) { | ||
| throw new Error("Cannot thread_send to yourself."); |
There was a problem hiding this comment.
Reject bound callers that send to themselves
When a bound agent calls thread_send with its own thread as the target but omits fromThreadId, resolveCallerId correctly returns the bound thread ID, yet this condition checks only the omitted argument. The call therefore proceeds as an anonymous self-send; because the caller is normally running, it queues a prompt that starts another turn after completion and can create unintended self-triggering loops. Compare the resolved fromId with thread.id regardless of whether the argument was supplied.
Useful? React with 👍 / 👎.
Codex Review SummaryThis 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. |
Omitting
fromThreadIdused to skip the human gate onthread_stopandthread_archive, so any agent could stop or archive another thread in its project. The caller is now bound on the coder-threads MCP URL (?threadId=), the same way#671boundprojectId. Closes #1432.Changes
fromThreadIdcan no longer stop or archive another thread without approval.fromThreadIdthat disagrees with the bound session is rejected.isAutoTurncannot run on a claimed lead id.Verification
node --test --test-name-pattern='#1432|thread_stop of another|thread_archive of another' electron/test/orch-server.test.js— 5/5 passorch-server,orch-merge,kimi-home, andpairingsuites were greenNotes for reviewers
Read the three
#1432tests first, thenresolveCallerId/assertCrossThreadApprovedinelectron/orchServer.js, then the URL bind inelectron/memory-sup.js. Stale MCP configs without?threadId=no longer treat omit as self; the next in-app turn rewrites the bound URL.cursor-grok-4.6 via Cursor
Made with Cursor