Skip to content

Close the thread_stop/thread_archive approval bypass - #1598

Merged
currentbits merged 1 commit into
mainfrom
coder/close-thread-stop-thread-archive-approva-0e20cd
Oct 11, 2026
Merged

currentbits merged 1 commit into
mainfrom
coder/close-thread-stop-thread-archive-approva-0e20cd

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Omitting fromThreadId used to skip the human gate on thread_stop and thread_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 #671 bound projectId. Closes #1432.

Changes

  • A worker that omits fromThreadId can no longer stop or archive another thread without approval.
  • Self-stop and self-archive stay ungated when the bound caller is the target.
  • A claimed fromThreadId that disagrees with the bound session is rejected.
  • Merge/PR use the same bound caller, so isAutoTurn cannot run on a claimed lead id.
  • Pairing clients stay on their own capability-token handlers.

Verification

  • node --test --test-name-pattern='#1432|thread_stop of another|thread_archive of another' electron/test/orch-server.test.js — 5/5 pass
  • Earlier this session: full orch-server, orch-merge, kimi-home, and pairing suites were green
  • Not tested: live Auto/Bypass run against a second thread in the app

Notes for reviewers

Read the three #1432 tests first, then resolveCallerId / assertCrossThreadApproved in electron/orchServer.js, then the URL bind in electron/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

…#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]>
@currentbits
currentbits merged commit d11f590 into main Oct 11, 2026
6 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread electron/orchServer.js
Comment on lines +752 to +753
} else if (args.fromThreadId && String(args.fromThreadId) === String(thread.id)) {
throw new Error("Cannot thread_send to yourself.");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T19:19:21.133728Z fe8e280 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Close thread_stop/thread_archive approval bypass

1 participant