Skip to content

LOCAL: hold orchestration mail pointers while the user types - #69

Merged
kiwidream merged 2 commits into
swaplabs/mainfrom
kiwidream/notice-typing-guard
Oct 28, 2026
Merged

kiwidream merged 2 commits into
swaplabs/mainfrom
kiwidream/notice-typing-guard

Conversation

@kiwidream

@kiwidream kiwidream commented Oct 28, 2026 •

Copy link
Copy Markdown
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​323 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​319
Prod 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​155 $\color{#cf222e}{\Huge{\mathbf{−}}}$​16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​139

ELI5

Orca used to type "You have 1 orchestration message…" and press Enter in a coordinator's terminal even while you were typing there, so the notice landed in your half-written message and got sent with it. Now it waits until you stop typing, and it never types a notice that only says workers are alive.

What Changed

Before: the mailbox pointer lane (mailbox-pointer-stage.ts) wrote formatMessagePointer(...) into the coordinator's PTY and staged Enter, with no regard for user input. Most of these notices were for heartbeat messages alone.

After:

  • Heartbeat-only batches type nothing. Heartbeats stay undelivered and are counted in the next real pointer, just as check returns them. A full page of heartbeats still lets newer mail through.
  • The pointer holds while you are typing. It waits while keys from any client reached the PTY in the last 4s, or while keys typed since the last submit or clear are under 2 minutes old. The existing delivery recheck sends the pointer once the hold lifts.
    • The signal is main's TerminalRunFactsRegister. It records driving input from desktop IPC and from remote and mobile RPC in the same process as the mailbox lane, so no version skew applies.
  • A pointer you typed behind is never submitted. If you type after the pointer was written but before its Enter (including a deferred Enter), the Enter is skipped. The pointer is settled as delivered and left in the composer, and its mail stays unread for check.
  • The notice text and format are unchanged. The structured-chat lane is unchanged too; it has no PTY composer.

Why

The operator reported that notices regularly interrupt their typing. Suppressing heartbeat-only pointers removes most notices, and holding the rest while someone is typing removes the rest of the interruptions. The rejected alternative was a type filter on the coordinator's own check --wait: it only helps while a waiter is running, and that waiter returns on every heartbeat.

Linked Issue

N/A: operator request in session.

Visual Proof

N/A: no visual change. The behaviour is covered by timer-driven tests in which the typed output is checked. A live check in a coordinator terminal is pending.

Testing

  • New orchestration-mailbox-typing-hold spec: 9 tests, each checked by mutating the change. Covers heartbeat-only, a mixed batch, deferral and single delivery, typing during the Enter delay, new mail during a hold, and fallback.

  • Updated eligibility, submit, stage and run-facts tests.

  • In targeted runs, 135 of 137 runtime/orchestration/wait test files passed:

    • The open-dialog draft test was updated to send Enter, and now passes.
    • The runtime-clone test fails only because the GPG preview refuses a fixture commit; it passes with fixture signing off.
  • pnpm check:changed --maxWorkers=2 --base=refs/remotes/swaplabs/swaplabs/main was interrupted twice by the operator to relieve host memory. Run 1's format and lint findings are fixed. A full run follows now that the PR is open, and its results will be posted here.

  • I manually tested these changes locally (pending live coordinator-terminal check)

  • Automated tests added/updated, or explained why not below

AI Disclosure

Prepared by Claude Code (Claude Opus 5.5) at the operator's request.

Review

Opened at the operator's request to "open PRs asap and run tests after". The local review and coordinator test runs follow. This is generic Orca behaviour that stablyai/orca would likely want, but it is not on the approved upstream list, so it stays fork-only (LOCAL:) for now.

Agent skill upstream boundary

  • Not applicable: runtime mailbox delivery; no agent skill.

Notes

  • Security: none affected.
  • Cross-platform: PTY-agnostic, so macOS, Linux and Windows/ConPTY behave the same.
  • Remote and mobile: input from paired desktops and mobile counts, because both arrive through the runtime's own input path.
  • Backward compatibility: the notice text is unchanged and the structured lane is untouched.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred): the full check:changed run follows

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Orca typed "You have N orchestration messages" plus Enter into a
coordinator's prompt even while the user was composing there, so the
notice landed inside their draft and was submitted with it. Most of
those notices were for heartbeats alone.

- A pointer batch of only heartbeats types nothing. Heartbeats stay
  undelivered and are counted in the next real pointer, as `check`
  returns them. A full page of heartbeats still lets newer mail through.
- Delivery holds while keys from any client reached the PTY in the last
  4 s, or while keys typed since the last submit or clear are under
  2 min old. The existing delivery recheck redrives the pointer once
  the hold lifts. The signal is main's TerminalRunFactsRegister, which
  records `driving` input from desktop IPC and remote/mobile RPC in the
  same process as the mailbox lane, so no version skew applies.
- A pointer the user typed behind before its Enter (including a
  deferred Enter) is never submitted. It is settled as delivered and
  left in the composer, and its mail stays unread for `check`.

The structured-chat lane is unchanged: it has no PTY composer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

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-28T15:05:56.551357Z a0eaff6 Manual request
ℹ️ 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.

@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: c4cb431071

ℹ️ 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".

…hold

An unmodified Kitty Enter (CSI 13 u, CSI 13;1 u) left the unsent-draft hold up for two minutes. Reuse the Enter encodings the question-answer inference already recognizes; Shift+Enter (CSI 13;2 u) stays an edit (Codex review on #69).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kiwidream

Copy link
Copy Markdown
Author

Addressed the Kitty Enter finding in a0eaff6.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: a0eaff6af6

ℹ️ 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".

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.

1 participant