Skip to content

refactor: extract helpers that agent-status files need room for - #30260

Merged
nwparker merged 1 commit into
mainfrom
nwparker/osc7501-prep
Oct 19, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/osc7501-prep

Conversation

@nwparker

@nwparker nwparker commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Moves five small pieces of code into their own helpers so the files they lived in have room for the OSC 7501 work stacked on top. Nothing behaves differently.

What Changed

No user-visible change. Five extractions, each moved as is:

  • pane-agent-identity.ts: the confirmed-shell tab-title reset, now confirmed-shell-agent-title.ts
  • SortableTab.tsx: its activity-status selector, now the useTerminalTabActivity hook
  • agent-status-event-applicator.ts: the Pi provider-session partial update, now agent-status-partial-updates.ts
  • terminal-derived-agent-facts.ts: resolving which panes a PTY's status belongs to, now resolveTerminalAgentStatusTargets
  • server-row-ownership.ts: notifying row-mutation listeners, now notifyStatusRowMutationListeners

Why

Each of these files sits at its max-lines limit, and the next PR adds to every one of them. Extracting first, rather than disabling the rule or splitting during the feature PR, keeps the feature diff purely additive and this one easy to verify as a move.

Stack:

  1. refactor: extract helpers that agent-status files need room for #30260 (this PR) prep refactors
  2. feat(agent-status): read OSC 7501 program status beside hooks #30261 OSC 7501 core
  3. feat(agent-status): show OSC 7501 program status in rows and tabs #30262 OSC 7501 UI

Linked Issue

N/A (maintainer change; no pre-existing issue)

Visual Proof

N/A: pure refactor with no visual or interaction change.

Testing

  • I manually tested these changes locally

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

  • Existing tests: the terminal-pane, tab-bar, IPC-hook, agent-hooks and runtime suites pass (10,265 tests). The one failure, orca-runtime.test.ts (badgeColor on runtime cloneRepo), also fails on main.

  • No new tests: behaviour is unchanged.

  • Static checks: typecheck and lint are clean.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No security, platform, SSH, mobile or compatibility impact; code moves only.

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)

No behavior change. Moves cohesive pieces out of files at their line limit
so the OSC 7501 program-status work on top reads as additions:

- pane-agent-identity: the confirmed-shell tab-title reset
- SortableTab: its activity-status selector, into useTerminalTabActivity
- agent-status-event-applicator: the Pi provider-session partial update
- terminal-derived-agent-facts: resolving a PTY's status target panes
- server-row-ownership: notifying row-mutation listeners
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d9614ce7-e389-486f-8638-39bbb46e9d70
📥 Commits

Reviewing files that changed from the base of the PR and between a2946f0 and 0d28c02.

📒 Files selected for processing: 8
  • src/main/agent-hooks/server/server-row-ownership.ts
  • src/main/runtime/terminal/output/terminal-derived-agent-facts.ts
  • src/renderer/src/components/tab-bar/SortableTab.tsx
  • src/renderer/src/components/tab-bar/use-terminal-tab-activity.ts
  • src/renderer/src/components/terminal-pane/pty-connection/confirmed-shell-agent-title.ts
  • src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts
  • src/renderer/src/hooks/ipc-events/agent-status-event-applicator.ts
  • src/renderer/src/hooks/ipc-events/agent-status-partial-updates.ts

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

📝 Walkthrough

The changes update status-row listener notification and terminal status event dispatch. The tab bar now obtains activity status through a hook, and confirmed-shell title handling uses a dedicated helper. Provider-session-only status events now use a helper that validates updates and applies them through a batch transaction or directly through the store.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 0d28c

This refactor moves existing logic into helpers with no intended behavior change. No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 8 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
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.
Title check Passed The title clearly describes the main change: extracting helpers from agent-status files to make room for subsequent work.
Description check Passed The description is complete and aligned with the template. It explains the purpose, lists the extracted helpers, documents the lack of behavior changes, provides testing results, addresses visual proo…
Full details: Description check

Explanation

The description is complete and aligned with the template. It explains the purpose, lists the extracted helpers, documents the lack of behavior changes, provides testing results, addresses visual proof, and completes the checklist.

  • Fix all pre-merge checks with AI
✨ 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.

@nwparker
nwparker merged commit 8908fde into main Oct 19, 2026
37 checks passed
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