Skip to content

fix(server): a moved thread arrives with its pull request switches off, and fenced - #977

Merged
badcuban merged 4 commits into
mainfrom
fix/step4a-security
Nov 17, 2026
Merged

badcuban merged 4 commits into
mainfrom
fix/step4a-security

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

Two problems in #976 (a thread moves with what it had going), found by Vercel Security Review after it merged:

  1. A linked computer could make this one merge pull requests with its own GitHub sign-in. A move carried auto-fix and auto-merge switches, the import turned them on, and the watcher here acted on them, even for a link capped at Supervised.
  2. A moved thread that starts work on arrival had the full agent tools, including reading other threads in the project. Threads another computer starts are fenced from those tools; moved ones weren't.

How it's fixed

  • Switches arrive off, every one. What was on there is kept as an offer (movedFrom.pullRequestSwitches). A notice and the "Moved here" line say so, with Turn on. That sends the normal command from the user's own app.
  • Moved threads are fenced. Every import sets movedFrom.fenced. One shared rule (orchestration/linkFence.ts) applies the same fence as link-started threads: tool issuance, the thread and schedule tool guards (thread_read and thread_list included), and scheduled continuation.
  • What lifts the fence. Only a turn started by a message the user sent on this computer; the server alone sets liftsMoveFence. The arrival message, carried queued messages, messages from another thread, an assistant or a scheduled task, restart or usage resumes, and auto-fix turns (keepsMoveFence) never lift it.
  • After the fence lifts, the session restarts with its conversation, so the agent gets its tools back.
  • Compatibility: only new optional fields.
  • Docs: Part 3e in docs/design/fleet.md and the app guide say all this.

Checks

  • fmt, lint, typecheck.
  • Server suite with replays.
  • Web unit 3,251.
  • Move browser spec 17/17.
  • New tests:
    • switches arrive off, and the local turn-on works;
    • arrival, carried and auto-fix turns keep the fence;
    • the user's own message lifts it;
    • thread_read and thread_list refuse while fenced;
    • the fence and the offer survive a restart.

Not done yet: the outside review was refused because Threadlines' limit on agent requests was reached. It runs next and any findings get fixed in a follow-up. No live two-computer run of this change.

…f, and fenced

What a move carries comes from another computer, so it gets no more trust
than work that computer's agent starts here over the link.

Pull request switches arrive off, every one. The linked pull requests still
come along. What was on rides in movedFrom.pullRequestSwitches; the "Moved
here" line and a new notice above the message box say what was on, and Turn
on sends the normal thread.pull-request-automation.set from the user's
client. Any switch set here clears the offer. The import decision no longer
turns switches on whatever its command says.

A moved thread works behind the link fence (movedFrom.fenced) until a
message the user sent here starts a turn in it (liftsMoveFence on that
turn-start-requested). The arrival message, the queued messages the move
carried, and anything Threadlines or an agent sends (auto-fix included, via
keepsMoveFence) leave it up. One rule (orchestration/linkFence.ts) now
fences both kinds of thread: tool issuance in the reactor, the thread and
schedule tool guards (thread_read and thread_list included), and continuing
on a schedule. A session started fenced restarts with resume once the fence
lifts, so the agent gets its tools. fleet.md Part 3e and the app guide say so.
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 17, 2026 7:34pm UTC

Request Review

@badcuban
badcuban added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@badcuban
badcuban added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
…efore settling

settleReady could land before the reactor marked the first turn running, so the user's message looked mid-turn and the restart was put off by design; the tests now wait for the running mark first, as another test in the file already does. 25/25 runs green.
@badcuban
badcuban added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@badcuban
badcuban added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit d20b11e Nov 17, 2026
24 checks passed
@badcuban
badcuban deleted the fix/step4a-security branch November 17, 2026 20:10

This branch was previously deployed

1 inactive deployment
Preview — 3157a600 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant