Skip to content

refactor(agent-status): delete two launch-config accessors left with no callers - #22032

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/dead-launch-config-accessor-cleanup
Sep 21, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/dead-launch-config-accessor-cleanup

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​35 $\color{#cf222e}{\Huge{\mathbf{−}}}$​31
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 $\color{#cf222e}{\Huge{\mathbf{−}}}$​71 $\color{#cf222e}{\Huge{\mathbf{−}}}$​69

ELI5

Two small lookup functions had nothing left calling them. A recent cleanup removed their last real user, and they were deliberately left behind so they could be deleted separately. This deletes them.

What Changed

Nothing changes for anyone using the app. This is dead-code removal only.

Two functions that looked up an agent's "launch config" (the command, arguments, and environment an agent terminal was started with) are gone:

1. getAgentLaunchConfigForStatusMetadata — a renderer store method. It found a launch config from a loose bag of identity fields. It has a sibling, getAgentLaunchConfigForStatusEntry, that does the same lookup from a real status entry, and that sibling still serves the one remaining consumer (cold-restore resume startup). Removing the method also orphaned the getLaunchConfigForStatusMetadata helper behind it and the AgentLaunchConfigStatusMetadata type that only described its argument, so those were removed too.

2. getAgentStatusLaunchConfigForPaneKey — a main-process runtime method. It returned a terminal pane's launch config, but only if the caller presented the matching launch token.

Test mocks that existed purely to satisfy the removed store method were stripped out. The tests holding those mocks are about other behaviour and remain.

Net: 106 lines removed, 6 added (−100).

Why

#21844 removed the Codex launch-argument attention suppressor. That suppressor was the last production caller of both functions. It read a pane's launch config, string-matched the arguments to guess whether the agent was in auto-approve mode, and suppressed a status row on that basis. Once that guessing was replaced by reading the real reviewer identity at the source, both lookups had no callers left.

Leaving an unused public accessor on a store slice and a runtime service is not free: it stays in the type contract, every test double has to keep implementing it, and the next person reading the file cannot tell whether it is load-bearing.

Why delete rather than keep them for a future caller. Each is a generic-looking accessor, so I checked whether it was genuinely redundant rather than merely idle:

  • For the renderer method, the surviving sibling covers the only live use, and the sibling is the better-typed of the two (it takes a status entry rather than a hand-assembled metadata object).
  • For the runtime method, its two remaining references were assertions in the launch-authority retirement test, so the real question was whether deleting it would lose real coverage. It does not. Retirement sets pty.launchToken to null, and the accessor returned undefined purely because of that null. The same test already asserts verifyOrchestrationCompatibilityCaller flips from non-null to null, which is driven by that identical field and runs through a path with many production callers. The remaining assertion on listTerminals covers the separate launchAgent clearing. Retirement never cleared launchConfig itself, so there was no third property hiding in the removed assertions.

I confirmed that by ablation rather than by reading: with the accessor and its assertions already deleted, disabling only the pty.launchToken = null line makes the test fail on the surviving verifyOrchestrationCompatibilityCaller assertion. The behaviour is still pinned.

Linked Issue

No issue. Follow-up to #21844, which orphaned both accessors and noted they would be removed separately.

Visual Proof

N/A — no behaviour change. This removes functions that had no callers, so there is no user-visible surface to show before or after.

Testing

Verified against the full related suites, not just the touched files:

Suite Result
src/main/runtime 827 files, 8438 tests passed
src/renderer/src/components/terminal-pane 475 files, 4564 tests passed
src/renderer/src/store 367 files, 3379 tests passed
src/renderer/src/hooks 166 files, 1090 tests passed
tests/e2e/paired-runtime-rejected-input-remount.unit.test.ts 3 tests passed

Also: pnpm tc clean, oxlint clean on all 19 changed files, pnpm run check:code-quality:changed passed with 0 new findings.

Ablation check described under "Why": temporarily disabling the launchToken nulling makes the retirement test fail on its surviving assertion, confirming the deleted assertions were a duplicate view rather than unique coverage. That change was reverted.

Platforms: logic is platform-independent (no paths, shells, or process spawning touched). Exercised on macOS.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

No tests were added: this removes code, and the one test that referenced the removed runtime method keeps its coverage through assertions that were already there.

AI Disclosure

Review

Reviewer note: the load-bearing judgement is in the second bullet under "Why" — whether the two deleted assertions in terminal-creation-and-readiness.spec.ts were unique coverage. The ablation result is the evidence for "no".

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security: none — removes a token-fenced read, adds no new access path.
  • Cross-platform: no platform-dependent code touched.
  • Remote SSH: the removed runtime method read local PTY records and had no callers; the SSH execution boundary is unchanged.
  • Mobile: not reached by either symbol.
  • Backwards compatibility: both symbols are process-internal. Neither crosses the client/host wire, appears in an RPC method table, nor is reachable by string name — I grepped for quoted forms to rule out reflection.
  • Performance: neutral, marginally less code to load.

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 callers

#21844 removed the Codex launch-argument attention suppressor, which was the
last production caller of two launch-config lookups. Both were left in place
for a follow-up; this is it.

`getAgentLaunchConfigForStatusMetadata` (renderer store) looked a launch config
up from a loose metadata bag. Its sibling `getAgentLaunchConfigForStatusEntry`
takes a real status entry and still serves the one live consumer, cold restore
resume startup. Deleting the metadata accessor also orphaned its
`getLaunchConfigForStatusMetadata` helper and the
`AgentLaunchConfigStatusMetadata` parameter type, so those go too.

`getAgentStatusLaunchConfigForPaneKey` (main runtime) returned a pane's launch
config behind a launch-token fence. Its two remaining references were
assertions in the launch-authority retirement test. They were a second view of
a state bit the test already pins: retirement nulls `pty.launchToken`, and the
surviving `verifyOrchestrationCompatibilityCaller` assertion fails when it
does not. Verified by ablation — disabling only the `launchToken` nulling
fails that assertion with the accessor already gone, so no coverage is lost.
Retirement never cleared `launchConfig` itself, so there was no second
property hiding in those assertions.

Test mocks that existed only to satisfy the removed store method are stripped;
the tests themselves are about other behaviour and stay.

No behaviour change.
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

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: a823b443-03db-4286-bf8e-841f496b5e2e

📥 Commits

Reviewing files that changed from the base of the PR and between 663d670 and 19d89d7.

📒 Files selected for processing (19)
  • src/main/runtime/orca-runtime-prune-mobile-session-tab-group-layout.ts
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts
  • src/renderer/src/components/terminal-pane/fish-color-scheme-child-stdin.node-pty.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-agent-session-resume.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-test-store-fixtures.ts
  • src/renderer/src/components/terminal-pane/pty-connection-test-store-state.ts
  • src/renderer/src/components/terminal-pane/remote-hidden-output-restore-outcomes.test.ts
  • src/renderer/src/components/terminal-pane/remote-hidden-output-restore-unavailable-banner.repro.test.ts
  • src/renderer/src/hooks/agent-hook-completion-background-turn-notifications.test.ts
  • src/renderer/src/hooks/agent-hook-completion-fresh-working.test.ts
  • src/renderer/src/hooks/agent-hook-completion-grok-notifications.test.ts
  • src/renderer/src/hooks/agent-hook-completion-notifications.test.ts
  • src/renderer/src/hooks/ipc-events-agent-status-store-test-fixtures.ts
  • src/renderer/src/store/slices/agent-status-contract.ts
  • src/renderer/src/store/slices/agent-status-launch-actions.ts
  • src/renderer/src/store/slices/agent-status-launch-config.ts
  • src/renderer/src/store/slices/agent-status-slice-contract.ts
  • src/renderer/src/store/slices/agent-status.ts
  • tests/e2e/paired-runtime-rejected-input-remount.unit.test.ts
💤 Files with no reviewable changes (13)
  • src/renderer/src/store/slices/agent-status.ts
  • tests/e2e/paired-runtime-rejected-input-remount.unit.test.ts
  • src/renderer/src/store/slices/agent-status-slice-contract.ts
  • src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts
  • src/renderer/src/store/slices/agent-status-contract.ts
  • src/renderer/src/components/terminal-pane/pty-connection-test-store-state.ts
  • src/renderer/src/components/terminal-pane/remote-hidden-output-restore-unavailable-banner.repro.test.ts
  • src/renderer/src/hooks/ipc-events-agent-status-store-test-fixtures.ts
  • src/renderer/src/components/terminal-pane/fish-color-scheme-child-stdin.node-pty.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-test-store-fixtures.ts
  • src/renderer/src/components/terminal-pane/pty-connection-agent-session-resume.test.ts
  • src/main/runtime/orca-runtime-prune-mobile-session-tab-group-layout.ts
  • src/renderer/src/components/terminal-pane/remote-hidden-output-restore-outcomes.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The store removes metadata-based launch configuration lookup, its contract type, helper, action, and public re-export. The runtime removes its pane-key launch configuration method. Runtime tests remove assertions for that method. Test fixtures and mocks are updated to use entry-based lookup or omit the removed action.

Priority: ⬇️ Low

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: removing two unused launch-config accessors.
Description check ✅ Passed The description is detailed and covers the required explanation, changes, rationale, testing, visual proof, compatibility considerations, and checklist. It references follow-up issue #21844, although …
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

This is dead-code removal with no behavioral surface — the two accessors lost their last production caller in #21844, and nothing in the HEAD tree still references them.

  • getAgentStatusLaunchConfigForPaneKey removed (src/main/runtime/orca-runtime-prune-mobile-session-tab-group-layout.ts) — a token-fenced launch-config reader on the prune runtime mixin, along with its now-unused SleepingAgentLaunchConfig and copySleepingAgentLaunchConfig imports.
  • getAgentLaunchConfigForStatusMetadata removed — the renderer store action, its AgentStatusSlice member, and its backing getLaunchConfigForStatusMetadata helper in agent-status-launch-config.ts; the surviving getAgentLaunchConfigForStatusEntry keeps its one live consumer in cold-restore-resume-startup.ts.
  • AgentLaunchConfigStatusMetadata type removed — agent-status-contract.ts plus the agent-status.ts re-export, since only the deleted method described its argument.
  • Test store doubles trimmed — the getAgentLaunchConfigForStatusMetadata: vi.fn(...) stub is dropped from ~10 mock state objects and their local MockStoreState/StoreState types; each affected test targets unrelated behavior and remains.

Verification

I grepped the checked-out head for all four removed identifiers (bare and quoted): zero remaining references, so no dangling imports, RPC/reflection string lookups, or docs mentions. agent-status-launch-config.ts still consumes its surviving imports (getTabIdFromPaneKey, getLeafIdFromPaneKey, registryEntryMatchesStatus), so nothing was orphaned.

I also checked the PR's load-bearing coverage claim against source: retirePtyAgentLaunchAuthority (orca-runtime-get-orchestration-dispatch-authority.ts:127) nulls launchToken, launchIncarnationId, and launchAgent but never launchConfig, and verifyOrchestrationCompatibilityCaller requires a non-empty launchToken before hashing it. The two deleted assertions in terminal-creation-and-readiness.spec.ts were therefore a duplicate view of the launchToken nulling, which the surviving verifyOrchestrationCompatibilityCaller assertion already pins. Retirement behavior is additionally covered in orchestration-compatibility-authority.test.ts and orca-runtime-structured-tui-tab-binding.test.ts:152. The ablation reasoning in the PR body holds.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron check (hidden dev build)

This pull request only deletes launch-config lookups that nothing calls. Those functions never painted a control, so there is no before/after behavior to show. The screenshot is the app shell on this branch, after opening a throwaway local git project in an isolated profile.

What is on screen: the sidebar lists project PR 22032 seed and its main worktree as inactive, the file tree shows README.md, the center pane has no terminal session, and the bottom bar shows the resource manager with zero terminal sessions and zero ports. No error overlay. The renderer console had 0 errors (dev-only tooltip and React Grab warnings).

Backing state from the same window:

  • Identity: Orca: brennanb2025/dead-launch-config-accessor-cleanup, dev branch brennanb2025/dead-launch-config-accessor-cleanup, worktree dead-launch-config-accessor-cleanup, repo root this worktree.
  • getAgentLaunchConfigForStatusMetadata is absent on the store. getAgentLaunchConfigForStatusEntry is still a function and returns undefined for an unknown pane. Launch-config map is empty. Agent status count is 0.

Not exercised: starting an agent, cold-restore resume (the surviving lookup's caller), SSH, or mobile.

workspace shell on this branch

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status

PASS — no code changes were needed.

  • The diff remains focused on removing two unreferenced launch-config accessors, their orphaned type/helper/imports, and stale test fixtures/assertions. Full-tree search found no remaining references; the entry-based accessor used by cold-restore resume remains intact.
  • Same-model senior review and final readiness/performance review found no proven P0, P1, or P2 issues, regressions, security or compatibility changes, or scope expansion.
  • Local validation passed: pnpm tc, 9 changed test files / 77 tests, pnpm run check:code-quality:changed, and git diff --check.
  • The rerun GitHub typecheck and aggregate verify jobs passed. The SSH watcher-isolation matrix is still running; the earlier failure was a load-average wait after relay/renderer restarts and did not touch this diff.
  • Hidden Electron/CDP validation passed on the exact branch identity. A representative uncropped screenshot is attached in the Electron evidence comment; the removed methods have no visible control. Agent launch, cold-restore resume, SSH, and mobile user flows were not exercised because this is deletion-only.

No release action is required from this review.

@brennanb2025
brennanb2025 merged commit 83a031c into main Sep 21, 2026
68 of 71 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