Skip to content

fix(server): a moved thread's fence lifts only for a message a person sent from the app - #979

Merged
badcuban merged 1 commit into
mainfrom
fix/move-fence-person-only
Nov 17, 2026
Merged

badcuban merged 1 commit into
mainfrom
fix/move-fence-person-only

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

Follow-up to #977. A thread that moved here is fenced from the agent tools until the user here sends it a message. The rule decided "the user sent it" by the absence of automatic markers. The outside review of #977 found two automatic paths that passed it:

  • Command output. Output from a command the agent asked for, delivered after the agent went idle, started a turn that lifted the fence.
  • Auto-fix. An auto-fix turn that overtook an automatic continue was turned into a follow-up and lost its keepsMoveFence marker, then lifted the fence when it ran alone.

The fix: an allow-list.

  • The fence lifts only when the message carries sentFrom, which only the server sets, from the connection's sign-in: withMessageSentFrom on the WebSocket and HTTP send paths. Clients' own copies are dropped by the schema.
  • The message must also not be imported, or written for the move.
  • Imported queued messages lose any sentFrom the other computer sent.
  • keepsMoveFence is removed; it only patched the old rule.

Known gap, failing safe: a session the server can't name, such as a browser paired through the relay, can't lift the fence. Its user sends from the app window, a normal browser or a phone instead.

Checks

  • fmt, lint, typecheck.
  • Server: decider, ProviderCommandReactor, threadToolHandlers, LinkMoves, ProjectionPipeline and the PR watcher, 533 tests; the full suite passed on the original branch (4,026).
  • New tests for both paths, a person's queued and direct messages, and a forged sentFrom on an imported message. Three of them fail with the fix removed.

Not run: the outside review. Threadlines' limit on agent requests was reached. It runs next and any findings get fixed in a follow-up.

… sent from the app

The fence lifted for any turn without an automatic marker, so command output delivered after the agent went idle, or an auto-fix requeued behind a continue, could lift it. It now lifts only when the message carries sentFrom, which only the server sets from the connection's sign-in, and isn't imported or written for the move; imported queued messages lose any peer-supplied sentFrom. keepsMoveFence is gone, since it only patched the old rule. Found in the outside review of #977.
@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 8:30pm UTC

Request Review

@badcuban
badcuban added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 635be89 Nov 17, 2026
24 checks passed
@badcuban
badcuban deleted the fix/move-fence-person-only branch November 17, 2026 21:25

This branch was previously deployed

1 inactive deployment
Preview — 5d29fa89 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