Skip to content

fix(runtime): preserve working hooks across idle title repaints - #32195

Merged
nwparker merged 2 commits into
mainfrom
nwparker/issue-18491-hook-title
Oct 24, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/issue-18491-hook-title

Conversation

@nwparker

@nwparker nwparker commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​92 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​84
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​29 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​29

A remote terminal's fresh working hook could become Done when its existing idle-class OSC title repainted, even with identical text. The canonical hook store remained working. Keep the hook's state and prompt when it postdates the start and latest invalidation of that same idle title interval; a real later title-state transition still retires the older row.

Refs #18491. This repairs the reproduced title-repaint case only. The original remote-machine incident and shared Active/Done dot styling have not been reproduced or changed. Current source already handles stale live-PTY rows as unverifiable and restores unfinished rows as unconfirmed; those remain separate from hook delivery.

Validation:

  • Before the fix, the real AgentHookServer → runtime session.tabs regression failed: a working store row projected Done after an identical idle-title repaint.
  • Tests cover identical and changed-text idle repaints, a later working→idle transition, and a later genuine done hook. Existing coverage includes stale/replayed/restored evidence, shell titles, questions, heartbeat publication and title fanout budgets.
  • 91 tests across 9 files passed, including the existing status/heartbeat/fanout reliability command; node typecheck, changed-code quality, formatting and diff checks passed.

Reliability contract:

  • Invariant — agent-session.status-evidence: a fresh hook that follows an idle interval must survive repainting that interval. Repaint time cannot manufacture a new completion boundary or renew hook freshness.
  • Failure source: [Bug]: Sidebar shows agent as done while it is still working (remote runtime projection synthesizes 'done') #18491; reproduced through the canonical AgentHookServer store, actual PTY OSC ingestion and session.tabs publication.
  • Oracle: after an idle title, ingest a working hook and verify working publication; repaint the idle title and require the canonical working state/prompt to remain published. Actual later working→idle and done-hook controls still settle.
  • Gate: existing terminal-performance.remote-hidden-retention-budget status/heartbeat/fanout command, plus targeted renewal and stale-row tests. Physical paired-client rendered acceptance remains an explicit gap.
  • Coverage: macOS deterministic host runtime and publication covered with a synthetic PTY boundary. Daemon PTY, SSH/remote transport, WSL, mobile/relay rendered journeys and Linux/Windows physical runs remain gaps; all consume the same platform-independent host projection. Local PTY I/O, input, attach, resize and exit code are unchanged. Folder-workspace versus Git-worktree distinction is not consulted. No wire contract or capability change; mixed-version clients receive existing status fields.
  • Performance: constant-time checks using existing PTY timestamps; no new scan, allocation, timer, polling, process query or status-republish path. Existing title fanout/heartbeat budget tests run with the regression.
  • Diagnostics: deterministic before/after test logs and source hashes in the issue audit evidence; no new logs or raw terminal content collection.
  • Residual gaps: no claim that all title-based completion inference, the original reporter's exact server setup, or Active/Done styling is resolved. Live paired Electron/mobile and physical provider tests were not run.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d9b4e723-2730-449b-8683-811628d7b9d2
Commits

Reviewing files that changed from the base of the PR and between 868e3ae and 8812512.

Files selected for processing: 3
  • src/main/runtime/mobile-agent-status-permission-renewal.test.ts
  • src/main/runtime/orca-runtime-hook-agent-status-projection.test.ts
  • src/main/runtime/runtime-mobile-agent-status-projection.ts

No actionable comments were generated in the recent review.

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d0b3dc3b-2007-4001-973b-a3f89d6b3409
📥 Commits

Reviewing files that changed from the base of the PR and between 54e8ee5 and 868e3ae.

📒 Files selected for processing: 3
  • src/main/runtime/mobile-agent-status-permission-renewal.test.ts
  • src/main/runtime/orca-runtime-hook-agent-status-projection.test.ts
  • src/main/runtime/runtime-mobile-agent-status-projection.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Walkthrough

The runtime now preserves fresh working hook status when an idle-class title repaint does not confirm a status change. The same evidence check applies to mobile status renewal and live hook-row projection. Tests cover idle-title repaints, a genuine idle transition, and a later done hook.

Priority: Normal

Merge Risk: Minimal · up to 868e3

The idle-title repaint fix is mergeable after normal checks; no concrete unresolved behavior risk was established.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description clearly explains the bug, implementation intent, test coverage, reliability contract, and known gaps. However, it omits most required template sections, including ELI5, What Changed, W… Complete the required template sections. Add ELI5, What Changed, Why, Visual Proof with screenshots or an explicit N/A and reason, Review, Notes, and Checklist details. Replace “Refs #18491” with the actual linked issue or the repository-re…
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: preserving working hooks across idle title repaints.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description clearly explains the bug, implementation intent, test coverage, reliability contract, and known gaps. However, it omits most required template sections, including ELI5, What Changed, Why, Visual Proof or an explicit N/A, Review, Notes, and Checklist. It also provides only “Refs #18491” instead of the required linked issue format.

Resolution

Complete the required template sections. Add ELI5, What Changed, Why, Visual Proof with screenshots or an explicit N/A and reason, Review, Notes, and Checklist details. Replace “Refs #18491” with the actual linked issue or the repository-required issue reference format. Confirm the testing checkboxes and AI Disclosure requirements.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

# Conflicts:
#	src/main/runtime/runtime-mobile-agent-status-projection.ts
@nwparker

Copy link
Copy Markdown
Contributor Author

Maintainer note: merged current origin/main into this branch (8812512) to resolve the conflict in runtime-mobile-agent-status-projection.ts. The conflict was additive: this PR's workingHookOwnsIdleTitleInterval guard sits next to main's new completedTurnFields/demoteRuntimeMobileAgentStatus, and both are kept unchanged. Focused runtime projection/renewal suites pass locally (72 tests across 6 files). #32156 changes hook-vs-program-status precedence for waiting/blocked rows in the agent-hooks server, which is a separate layer, and this guard only applies to working hooks under an idle title, so the two do not overlap.

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