Skip to content

fix(agents): keep OMP identity and forward ask/approval events - #15713

Merged
brennanb2025 merged 7 commits into
mainfrom
brennanb2025/sta-4130-omp-identity-approvals
Aug 31, 2026
Merged

brennanb2025 merged 7 commits into
mainfrom
brennanb2025/sta-4130-omp-identity-approvals

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​304 $\color{#cf222e}{\Huge{\mathbf{−}}}$​162 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​142
Prod 15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​470 $\color{#cf222e}{\Huge{\mathbf{−}}}$​146 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​324

ELI5

When an OMP pane is live, Orca could still call it Pi, hide the question it is asking, and leave a permission prompt looking like a hang. This PR keeps the OMP label once the hook knows it is OMP, publishes the actual question, and reports tool-approval waits as "action required" until they are answered.

What Changed

  • Pi is marked as the generic member of the pi-compatible title group. A specific OMP identity is no longer rewritten through a Pi owner; a genuine Pi→OMP re-route still works.
  • OMP ask still maps to blocked, and now also publishes its { questions } payload on interactivePrompt.
  • The generated status extension registers tool_approval_requested / tool_approval_resolved (OMP-gated, omitted for Prime). The listener maps request → blocked and resolve → working.

Does not change agent_end / willContinue settlement. That is #15658.

Why

The Pi-compatible title group treated every owner as equally specific, so a pane that later ran omp (or whose hook already said OMP) was painted back as Pi. The ask path already knew OMP ask was blocking, but it refused to serialize the questions. OMP does not emit approval events unless an extension listens, and Orca never did — so a permission wait was indistinguishable from a hang.

Supersedes #14279 for these remaining gaps. Thanks to @devatnull — the diagnosis that ask/approval/identity are missing from the OMP hook path is carried forward (Co-authored-by). This PR differs from #14279 in:

  1. Does not include the willContinue settle (owned by fix(pi): settle OMP status from the agent-end contract #15658).
  2. Models the identity rule as titleIdentityFallback on Pi rather than a hardcoded omp special case.
  3. Serializes OMP ask input directly; no tool-name alias to ask_user_question.
  4. Publishes the blocked approval state only. Does not synthesize an { approval } native-chat card whose 1/ESC buttons are Claude's mapping, not OMP's Approve/Deny selector.

#14605 attempted the same remaining gaps on a stale base and bundled the settle half; this is the current-main slice without that overlap.

Linked Issue

STA-4130
Related to #14278 (identity / ask / approval remaining items; stuck-working settle is #15658)

Visual Proof

N/A — generated extension + shared status normalization. The user-visible effect is which existing sidebar/tab label and state an OMP pane already renders (OMP vs Pi, blocked vs working, live question card vs none). Asserted at the identity and hook seams.

Testing

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

TDD:

Stage Result
Pre-fix 8 failed (identity downgrade, missing ask payload, approval events dropped / unregistered). Genuine Pi→OMP re-own still passed.
Post-fix 95/95 focused tests passed, plus 32 existing extension tests
Neutered production hunks, tests kept Same 8 failed again

Also: pnpm typecheck passed; oxlint --deny-warnings on changed files clean; check:max-lines-ratchet OK; oxfmt on changed files only.

Review

  • Security: no new trust boundary. Approval events arrive on the existing authenticated loopback hook route. reason is length-normalized through existing readString / toolInput handling.
  • Cross-platform: generated extension is plain JS. Runtime re-route still uses existing process.title / argv name matching (Windows .exe already covered).
  • Remote SSH: no wire/RPC/stream opcode change. New optional hook-JSON fields (reason, approval_mode, approved) sit on the existing HTTP POST. Published status uses existing blocked/working + interactivePrompt. Older clients decode both; they now see OMP action-required / question cards (host-projection change, which is the fix).
  • Mobile: benefits without a client change. Mobile cannot read an OMP transcript, so the live ask payload is the only way an OMP question card can reach it; it uses the same { questions } parser.
  • Backwards compatibility: Pi and Prime paths unchanged except the shared predicate refactor. OMP builds that never emit approval events behave as today. The extension re-registers on next launch.
  • Performance: two extra no-op handlers on non-OMP Pi-compatible runtimes (isOmpRuntime() is cached).

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.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • 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 (scoped checks run locally; CI covers the full run)

Author

  • X / Twitter: @BrennanKB5

Out of scope (file separately)

…130)

A live OMP pane was re-owned as Pi because the generic pi-compatible
fallback always won, ask events blocked without a question payload, and
OMP suppressed tool_approval_* unless an extension registered handlers.

Mark Pi as the title-group fallback so a specific OMP identity is not
downgraded, publish OMP ask input as the existing questions envelope, and
forward tool_approval_requested/resolved onto blocked/working.

STA-4130
Related to #14278

Co-authored-by: devatnull <[email protected]>
@coderabbitai

ghost commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds launch-aware pane ownership records and propagates ownership metadata through runtime, web-session, title, display-title, and sidebar paths. Tab-agent signal imports now use a dedicated module. OMP approval requests and resolutions are forwarded through generated handlers, with hook normalization and coverage for supported and unsupported agents. One Codex test file only removes blank lines.

Merge Risk: 🟡 Moderate · up to 27998

The PR improves OMP identity and exposes questions and permission waits, but unresolved approvals can be shown as completed or become stale, and renderer changes may still fail typechecking or discard runtime status updates. Merge should wait for these issues to be fixed or explicitly accepted by the owner.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 40 functions across 32 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 summarizes the main changes: preserving OMP identity and forwarding ask and approval events.
Description check ✅ Passed The description follows the required template and explains the change, motivation, linked issue, visual impact, testing, review considerations, scope, and checklist status. It also clearly notes that …
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 follows the required template and explains the change, motivation, linked issue, visual impact, testing, review considerations, scope, and checklist status. It also clearly notes that full lint, test, and build commands were not run locally but are covered by CI.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

The pi-compatible fallback treated every generic Pi owner as inferred, so an
explicit launch-Pi pane (and a launchless Pi pane with an OMP-shaped title)
was re-owned as OMP. Launch provenance now stays authoritative; only an
inferred status-frame owner yields to a specific sibling, and same-group
titles no longer count as reuse.

STA-4130
@brennanb2025

ghost commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

Discriminator for Pi/OMP identity (follow-up)

The previous titleIdentityFallback rule treated (owner=pi, incoming=omp) as one case: incoming always won. That pair is actually two different situations, and they cannot be told apart from the agent names alone.

The discriminator is owner provenance: user-selected launch ownership vs an inferred status frame.

Case Owner Incoming Result
A — STA-4130 oscillation inferred pi (remote OMP reported Pi as live status) omp incoming wins — a generic status-frame owner yields to the specific sibling so the label cannot flap
B1 — pinned test, launch Pi launch pi hook/title omp owner wins — explicit launch is identity, not a fallback
B2 — pinned test, launchless Pi pane completed-hook pi title omp record wins — same-group titles are wrapper frames, not reuse

resolvePaneAgentOwnerRecord now returns { agent, ownerIsLaunch }. Launch / startup / typed-command evidence is authoritative and never yields. Only an inferred generic owner still yields to a specific sibling (Case A). Title reclaim additionally checks the raw title's identity group, so an OMP-shaped title cannot steal a Pi pane.

The two pinned assertions in use-tab-agent-pi-identity.test.ts are unchanged. Neutering the inferred-yield path makes keeps a live OMP identity from being downgraded by a generic Pi owner fail (expected 'omp', received 'pi'), so Case A coverage is still load-bearing.

@brennanb2025

ghost commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Blocking conflict with the sibling PR in this batch

#15711 and #15713 add tests with byte-for-byte identical inputs and opposite expected outputs. They cannot both merge as written.

resolveTabAgentFromSignals({
  hasObservedAgentSignal: true, isRemote: false,
  title: "✳ Codex", hookAgent: null, processAgent: null,
  processShellForeground: true, sleepingSessionAgent: "codex", launchAgent: "codex"
})

Both underlying bugs are real: #15711/STA-3867 fixes a stale agent icon after /exit; #15713/STA-4130 keeps pane identity during a hibernation restore where the shell spawns before the agent relaunches.

No discriminator exists at this layer. The inputs are identical, so the resolver cannot separate "agent exited to shell" from "restore in flight". Narrowing #15711's guard from launchedAgentExited || processProvesShell to just launchedAgentExited fixes 2 of #15713's 3 new tests but not this one, because resolveLaunchedAgentExitEvidence itself treats local shell-foreground + observed-signal as exit evidence.

Fixing both needs new provenance — an explicit "restore in flight" signal, or a generation/timestamp marking the sleeping record as freshly re-seeded rather than left over.

Additionally, #15713 moves resolveTabAgentFromSignals into a new tab-agent-from-signals.ts, and that module carries the pre-#15711 unguarded precedence chain. Merging the two conflicts on use-tab-agent.ts. I verified the safety net holds — naive-resolving to #15713's side fails 6 of #15711's tests rather than reverting silently — but the resolver must carry the activeSleepingSessionAgent guard across, after which the contradiction above surfaces.

This is a product decision, not a merge mechanic.

ghost 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1ae532c4-dee3-460e-9d2b-8377b9549526

📥 Commits

Reviewing files that changed from the base of the PR and between df7460a and 5bf5064.

📒 Files selected for processing (28)
  • src/main/pi/agent-status-extension-source.test.ts
  • src/main/pi/agent-status-extension-test-harness.ts
  • src/main/pi/agent-status-handler-source.ts
  • src/main/pi/agent-status-omp-approval-forwarding.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/renderer/src/components/sidebar/worktree-agent-row-orchestration.ts
  • src/renderer/src/components/sidebar/worktree-agent-row-type.ts
  • src/renderer/src/components/sidebar/worktree-agent-rows.ts
  • src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts
  • src/renderer/src/components/terminal-pane/pty-connection.ts
  • src/renderer/src/components/terminal-pane/terminal-title-evidence.test.ts
  • src/renderer/src/components/terminal-pane/terminal-title-evidence.ts
  • src/renderer/src/lib/open-tab-occupant-agent.ts
  • src/renderer/src/lib/tab-agent-from-signals.ts
  • src/renderer/src/lib/use-tab-agent-opencode-native-title.test.ts
  • src/renderer/src/lib/use-tab-agent-pi-identity.test.ts
  • src/renderer/src/lib/use-tab-agent-process-signals.test.ts
  • src/renderer/src/lib/use-tab-agent-sleeping-session.test.ts
  • src/renderer/src/lib/use-tab-agent.test.ts
  • src/renderer/src/lib/use-tab-agent.ts
  • src/renderer/src/runtime/web-session-tabs-sync.ts
  • src/shared/agent-detection.test.ts
  • src/shared/agent-hook-listener-pi-compatible.test.ts
  • src/shared/agent-hook-listener.ts
  • src/shared/agent-title-owner.ts
  • src/shared/pane-agent-owner.test.ts
  • src/shared/pane-agent-owner.ts
  • src/shared/synthetic-agent-title.ts

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

Comment on lines +6 to +20
function orchestrationContextsEqual(
a: AgentStatusOrchestrationContext,
b: AgentStatusOrchestrationContext
): boolean {
return (
a.taskId === b.taskId &&
a.dispatchId === b.dispatchId &&
a.taskTitle === b.taskTitle &&
a.displayName === b.displayName &&
a.parentTerminalHandle === b.parentTerminalHandle &&
a.parentPaneKey === b.parentPaneKey &&
a.coordinatorHandle === b.coordinatorHandle &&
a.orchestrationRunId === b.orchestrationRunId
)
}

ghost Aug 21, 2026

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Include dispatchStatus in the equality check.

AgentStatusOrchestrationContext.dispatchStatus is runtime-authoritative. If the task and dispatch IDs stay the same but dispatchStatus changes, Line 37 creates the updated context, but Lines 42-44 discard it because this comparison ignores dispatchStatus. The sidebar can keep a stale dispatch status. Add this field to the comparison and cover a same-dispatch status transition with a regression test.

Proposed fix
     a.taskId === b.taskId &&
     a.dispatchId === b.dispatchId &&
+    a.dispatchStatus === b.dispatchStatus &&
     a.taskTitle === b.taskTitle &&
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function orchestrationContextsEqual(
a: AgentStatusOrchestrationContext,
b: AgentStatusOrchestrationContext
): boolean {
return (
a.taskId === b.taskId &&
a.dispatchId === b.dispatchId &&
a.taskTitle === b.taskTitle &&
a.displayName === b.displayName &&
a.parentTerminalHandle === b.parentTerminalHandle &&
a.parentPaneKey === b.parentPaneKey &&
a.coordinatorHandle === b.coordinatorHandle &&
a.orchestrationRunId === b.orchestrationRunId
)
}
function orchestrationContextsEqual(
a: AgentStatusOrchestrationContext,
b: AgentStatusOrchestrationContext
): boolean {
return (
a.taskId === b.taskId &&
a.dispatchId === b.dispatchId &&
a.dispatchStatus === b.dispatchStatus &&
a.taskTitle === b.taskTitle &&
a.displayName === b.displayName &&
a.parentTerminalHandle === b.parentTerminalHandle &&
a.parentPaneKey === b.parentPaneKey &&
a.coordinatorHandle === b.coordinatorHandle &&
a.orchestrationRunId === b.orchestrationRunId
)
}

…A-4130)

Title-completion suppression compared pick-a-winner ownership, so a Pi ready
frame looked like a different agent than a live OMP hook and fired a spurious
task-complete notification. Reuse checks now use the title-identity group.

STA-4130
@brennanb2025

ghost commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

Landing order: #15658 must land before this PR

#15658's review loop surfaced a state-machine collision between the two halves of the OMP work. Recording it here so it isn't lost.

  • fix(pi): settle OMP status from the agent-end contract #15658 owns willContinue / agent_end settlement. On its own it never emits tool_approval_*, so it cannot disagree with blocked.
  • This PR adds OMP approval forwarding (tool_approval_requested → blocked).
  • Combined, last-write-wins agent_end → done can clobber an unresolved tool_approval_requested → blocked when OMP posts a terminal agent_end while still waiting on an approval. The pane would read done while actually parked on a permission prompt — the exact symptom STA-4130 exists to fix.

The latch belongs here, after this branch rebases onto #15658's harness/agent_end work — not as a drive-by in #15658.

Separately, this PR still conflicts with #15711 on src/renderer/src/lib/use-tab-agent.ts because it splits resolveTabAgentFromSignals into tab-agent-from-signals.ts, and that new module carries the pre-#15711 unguarded chain. Whichever lands second must carry the other's guard across. Naive-resolving to this PR's side fails 6 of #15711's tests, so it will not revert silently — but it does need a deliberate resolution.

Current head 6b843efcd6 is verified green on my side: typecheck clean, 997 tests across the identity/notification suites, non-vacuous, gates clean, and the pinned drops a Pi title completion while compatible OMP hook status is active assertion intact.

@devatnull

ghost commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

hey, will i not appear as a contributor again? Same thing happened with bitbucket fixes I made too.

@brennanb2025

ghost commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Electron CDP visual validation

Validated in the exact child worktree dev build (Orca: brennanb2025/pr-15713-omp-identity-approvals, Dock tile Orca/ brennanb2025-pr-15713-omp-identity-approvals, CDP on this worktree's renderer). Real omp v17.0.5 launched in a pane with launchAgent: omp. Ask/approval status rendering was exercised through the live UI (sidebar + tab + native-chat); live OMP could not run a model turn (Warning: No models available).

Visible

  • Tab stays OMP ready (not Pi). Sidebar row is OMP + Blocked / Needs permission.
  • OMP ask { questions } renders a live native-chat card: “Which identity should this OMP pane keep?”
  • Approval-blocked (toolName: bash, no interactivePrompt) keeps OMP + Needs attention and does not synthesize a Claude-style Allow/Deny card.

Backing

  • Ask: state=blocked, agentType=omp, toolName=ask, interactivePrompt = { questions: [...] }.
  • Approval: state=blocked, agentType=omp, toolName=bash, toolInput=tools.approval.bash: prompt, interactivePrompt=null. Seeded title Pi - action required did not relabel the pane as Pi.

Gaps

1. Live OMP identity + blocked ask (sidebar/tab)

01-omp-identity-ask-blocked.png

2. Native-chat ask card from { questions }

02-omp-ask-question-card.png

3. Approval-blocked: OMP attention, no approval card

03-omp-approval-blocked-no-card.png

@brennanb2025

ghost commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Final preparation status

  • Review-until-clean completed with readiness-checklist at start/end, OSS precedent review, and adversarial correctness/performance/regression passes.
  • No code changes were warranted. Focused OMP identity/approval tests, node/web typechecks, reliability gates, changed-file lint, and diff checks passed.
  • Electron CDP validation confirmed the rendered OMP identity, native-chat ask card, and permission state; three uncropped screenshots are attached in the preceding visual-proof comment.
  • Remaining gaps are environmental: no live OMP model/hook flow was available, and SSH/mobile were not exercised.
  • The branch is unchanged but currently conflicts with main; resolve that before merge.

…-omp-identity-approvals

# Conflicts:
#	src/main/pi/agent-status-extension-test-harness.ts
#	src/renderer/src/components/terminal-pane/pty-connection.ts
#	src/renderer/src/lib/use-tab-agent.ts
#	src/shared/agent-detection.test.ts
#	src/shared/agent-hook-listener.ts
#	src/shared/agent-title-owner.ts
#	src/shared/synthetic-agent-title.ts
@coderabbitai

ghost commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@greptile-apps

ghost commented Aug 31, 2026 •

Copy link
Copy Markdown

Greptile Summary

The PR preserves OMP identity across Pi-compatible title signals and forwards OMP ask and approval events into shared agent status.

  • Registers and normalizes OMP approval-request and approval-resolution events.
  • Publishes OMP ask payloads as interactive prompts.
  • Threads pane-owner provenance through renderer, main-runtime, sidebar, and remote-session title projection.
  • Refactors pane identity and sidebar row resolution into shared helpers.

Confidence Score: 4/5

The PR is not yet safe to merge because inferred Pi ownership can still overwrite specific OMP identity on restored or mirrored panes.

The restored owner API accepts the newly threaded launch-provenance flag but does not use it, leaving the identity downgrade reachable when non-launch Pi evidence owns a pane and current evidence identifies OMP.

Files Needing Attention: src/shared/agent-title-owner.ts

Important Files Changed

Filename Overview
src/shared/agent-title-owner.ts Adds owner-provenance parameters but ignores them, leaving inferred Pi ownership able to downgrade specific OMP identity.
src/shared/pane-agent-owner.ts Adds a structured owner result that distinguishes launch-tier evidence from status-tier evidence.
src/main/pi/agent-status-handler-source.ts Registers OMP-gated approval lifecycle handlers and forwards their event fields.
src/shared/agent-hook-listener/providers/pi-family-events.ts Maps OMP approval requests to blocked and resolutions to working.
src/shared/agent-hook-listener/providers/pi-family-tool-fields.ts Serializes OMP ask questions and extracts approval context for shared status.
src/renderer/src/lib/tab-agent-from-signals.ts Centralizes tab identity precedence and computes owner provenance, but the downstream owner normalizer currently discards that provenance.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  OMP[OMP extension] --> Hook[Authenticated loopback hook]
  Hook --> Normalize[Pi-family normalizer]
  Normalize --> Status[Blocked or working status]
  Status --> Owner[Pane owner resolution]
  Title[Pi-compatible title/process signal] --> Owner
  Owner --> UI[Desktop and mobile pane presentation]
Loading

Comments Outside Diff (1)

  1. src/shared/agent-title-owner.ts, line 123-137 (link)

    P1 Inferred Pi overwrites OMP identity

    When a restored or mirrored pane has non-launch Pi ownership while current hook, status, or title evidence identifies OMP, these functions ignore ownerIsLaunch and replace the specific OMP identity with Pi, causing the pane to be labeled and published as Pi again.

    Knowledge Base Used:

Reviews (4): Last reviewed commit: "test(agents): update identity inventory ..." | Re-trigger Greptile

` pi.on('tool_approval_requested', (event${ctxParam}) => {`,
...captureSessionMetadata,
' if (!isOmpRuntime()) return',
" post('tool_approval_requested', {",

ghost Aug 31, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Approval events are discarded

When OMP requests or resolves tool approval, these handlers post event names that normalizePiCompatibleEvent does not recognize, so the normalizer returns null and the pane never transitions to blocked or back to working.

Knowledge Base Used: Agent integrations and hooks

ownerIsLaunch = false
): string {
return normalizeCompatibleAgentTitleForOwner(title, ownerAgentType)
return normalizeCompatibleAgentTitleForOwner(title, ownerAgentType, { ownerIsLaunch })

ghost Aug 31, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Owner options break typechecking

The changed identity call sites pass a third options argument, but the shared compatible-owner functions still declare only two parameters. TypeScript therefore reports Expected 2 arguments, but got 3, preventing these targets from typechecking or building, and the intended owner-provenance behavior is not implemented.

Knowledge Base Used:

ghost 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 624bdbe5-6c61-42a9-9c43-ef002190a5d0

📥 Commits

Reviewing files that changed from the base of the PR and between b8d5b04 and 93fbdb2.

📒 Files selected for processing (22)
  • src/main/codex/codex-index-heal-binary-contract.test.ts
  • src/main/pi/agent-status-handler-source.ts
  • src/main/pi/agent-status-omp-approval-forwarding.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/renderer/src/components/sidebar/worktree-agent-row-orchestration.ts
  • src/renderer/src/components/sidebar/worktree-agent-row-type.ts
  • src/renderer/src/components/sidebar/worktree-agent-rows.ts
  • src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts
  • src/renderer/src/components/terminal-pane/terminal-title-evidence.test.ts
  • src/renderer/src/components/terminal-pane/terminal-title-evidence.ts
  • src/renderer/src/components/terminal-pane/use-notification-dispatch.ts
  • src/renderer/src/lib/open-tab-occupant-agent.ts
  • src/renderer/src/lib/tab-agent-from-signals.ts
  • src/renderer/src/lib/use-tab-agent-opencode-native-title.test.ts
  • src/renderer/src/lib/use-tab-agent-pi-identity.test.ts
  • src/renderer/src/lib/use-tab-agent-process-signals.test.ts
  • src/renderer/src/lib/use-tab-agent-sleeping-session.test.ts
  • src/renderer/src/lib/use-tab-agent.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync.ts
  • src/shared/agent-hook-listener-pi-compatible.test.ts
  • src/shared/pane-agent-owner.test.ts
  • src/shared/pane-agent-owner.ts
🚧 Files skipped from review as they are similar to previous changes (18)
  • src/renderer/src/lib/use-tab-agent-sleeping-session.test.ts
  • src/renderer/src/lib/open-tab-occupant-agent.ts
  • src/shared/pane-agent-owner.ts
  • src/renderer/src/lib/use-tab-agent-pi-identity.test.ts
  • src/main/pi/agent-status-omp-approval-forwarding.test.ts
  • src/renderer/src/lib/use-tab-agent.test.ts
  • src/renderer/src/components/terminal-pane/use-notification-dispatch.ts
  • src/renderer/src/components/terminal-pane/terminal-title-evidence.ts
  • src/renderer/src/lib/tab-agent-from-signals.ts
  • src/shared/pane-agent-owner.test.ts
  • src/main/pi/agent-status-handler-source.ts
  • src/renderer/src/lib/use-tab-agent-opencode-native-title.test.ts
  • src/renderer/src/components/sidebar/worktree-agent-row-orchestration.ts
  • src/renderer/src/components/terminal-pane/terminal-title-evidence.test.ts
  • src/shared/agent-hook-listener-pi-compatible.test.ts
  • src/renderer/src/components/sidebar/worktree-agent-rows.ts
  • src/renderer/src/runtime/web-session-tabs-sync.ts
  • src/renderer/src/lib/use-tab-agent-process-signals.test.ts

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

Comment on lines +20 to +21
resolveCompatibleAgentTypeForOwner,
type CompatibleAgentOwnerOptions

ghost Aug 31, 2026

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.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Restore a consistent owner-options API across the affected callers and shared helpers. The callers pass a third ownerOptions argument and reference CompatibleAgentOwnerOptions, but the shared declarations currently expose only two-argument functions and do not export that type. TypeScript therefore rejects the calls and blocks the renderer build. Update the shared type and helper signatures to accept and forward the options, or remove the extra argument consistently from all callers, including orca-runtime.ts, worktree-title-derived-agent-rows.ts, and worktree-agent-row-type.ts.

📍 Affects 2 files
  • src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts#L20-L21 (this comment)
  • src/main/runtime/orca-runtime.ts#L8569-L8570

Source: Linters/SAST tools

@brennanb2025

ghost commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Conflict resolution and review complete.

  • Updated the PR branch to aed8ce4.
  • Restored OMP ask question payloads and approval requested/resolved state transitions in the refactored provider modules.
  • Fixed a merge-loss in the title-owner API that could cause runtime TypeErrors.
  • Focused verification: 11 test files / 237 tests passed, pnpm tc passed, and touched-file oxlint passed.
  • The full suite was bounded after unrelated relay/file-watcher and infrastructure failures; those were not caused by this PR diff.

The PR is currently open and GitHub reports it as mergeable; hosted checks are still running.

@brennanb2025

ghost commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

@devatnull You are credited on this PR: the original OMP commit 238fe84 includes your Co-authored-by trailer, and GitHub resolves it to your account. The conflict-resolution commits were mechanical and did not remove that attribution. The GitHub contributor graph updates after the commit lands on the default branch, so your contribution will appear there once this PR is merged.

@brennanb2025

ghost commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

CI is green. Updated the pane-agent identity inventory ratchet for the new signal modules and extended its repository scan timeout; all required checks now pass.

ghost 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 09af3c02-bd78-4a4d-bf6b-4d2ca6801e9a

📥 Commits

Reviewing files that changed from the base of the PR and between 93fbdb2 and 2799864.

📒 Files selected for processing (4)
  • src/shared/agent-hook-listener/providers/pi-family-events.ts
  • src/shared/agent-hook-listener/providers/pi-family-tool-fields.ts
  • src/shared/agent-title-owner.ts
  • src/shared/pane-agent-identity-inventory.test.ts

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

Comment on lines +34 to +36
const stateName =
isPiCompatibleAsk || isOmpApprovalRequest
? 'blocked'

ghost Aug 31, 2026

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.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Expect: an approval latch prevents agent_end/willContinue settlement from
# replacing blocked state before tool_approval_resolved arrives.
rg -n -C 8 \
  'tool_approval_requested|tool_approval_resolved|agent_end|willContinue|blocked|latch' \
  src/shared src/main

Repository: stablyai/orca

Length of output: 50370


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- applicable repository knowledge files ---'
find /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4 -maxdepth 2 -type f -name '*.md' -print

printf '%s\n' '--- target file map ---'
ast-grep outline src/shared/agent-hook-listener/providers/pi-family-events.ts

printf '%s\n' '--- target implementation and nearby tests ---'
sed -n '1,180p' src/shared/agent-hook-listener/providers/pi-family-events.ts
rg -n -C 12 \
  'tool_approval_requested|tool_approval_resolved|agent_end|willContinue|approval|blocked' \
  src/shared/agent-hook-listener

Repository: stablyai/orca

Length of output: 50369


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- relevant conventions ---'
cat /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions/src.md
printf '%s\n' '--- listener files ---'
git ls-files 'src/shared/agent-hook-listener/*' 'src/shared/agent-hook-listener/**/*' | sort
printf '%s\n' '--- exact approval/latch references in listener scope ---'
rg -n \
  'tool_approval_requested|tool_approval_resolved|pending.*approval|approval.*pending|approvalLatch|approval.*latch|willContinue|lastStatusByPaneKey' \
  src/shared/agent-hook-listener
printf '%s\n' '--- state definitions and status-write callers ---'
rg -n -C 8 \
  'export (type|interface).*HookListenerState|type HookListenerState|interface HookListenerState|lastStatusByPaneKey|normalizePiCompatibleEvent\(' \
  src/shared/agent-hook-listener src/shared

Repository: stablyai/orca

Length of output: 50369


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- normalization and cache-write path ---'
sed -n '1,150p' src/shared/agent-hook-listener.ts
sed -n '1,130p' src/shared/agent-hook-listener-test-harness.ts
printf '%s\n' '--- focused test files ---'
git ls-files 'src/shared/*agent-hook-listener*.test.ts' | sort
printf '%s\n' '--- OMP and approval tests ---'
rg -n -C 10 \
  'omp|tool_approval_requested|tool_approval_resolved|agent_end|approval' \
  src/shared/*agent-hook-listener*.test.ts
printf '%s\n' '--- issue/latch references in source and tests ---'
rg -n -i '15658|approval.?latch|pending.?approval|approval.?pending|willContinue' \
  src/shared src/main --glob '!**/*.map' --glob '*.ts' | head -200

Repository: stablyai/orca

Length of output: 50370


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- root normalizer ---'
sed -n '1,125p' src/shared/agent-hook-listener.ts

printf '%s\n' '--- OMP references in listener tests (filenames and matching lines only) ---'
rg -n \
  '(^|[^[:alnum:]_])omp([^[:alnum:]_]|$)|tool_approval_requested|tool_approval_resolved' \
  src/shared --glob '*agent-hook-listener*.test.ts' --glob '*.test.ts' \
  | grep -E 'agent-hook-listener|tool_approval' | head -120

printf '%s\n' '--- exact issue/latch references ---'
rg -n -i '15658|approval.?latch|pending.?approval|approval.?pending|willContinue' \
  src/shared/agent-hook-listener src/shared/agent-hook-listener.ts \
  --glob '*.ts' || true

Repository: stablyai/orca

Length of output: 7509


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- remainder of normalizeHookPayload ---'
sed -n '115,215p' src/shared/agent-hook-listener.ts

printf '%s\n' '--- OMP-focused test block ---'
sed -n '240,405p' src/shared/agent-hook-listener-pi-compatible.test.ts

printf '%s\n' '--- status acceptance callers ---'
rg -n -C 6 \
  'normalizeHookPayload\(|lastStatusByPaneKey\.set|payload\.state|transportPayload' \
  src/shared src/main \
  --glob '*.ts' \
  | grep -E 'agent-hook-listener|normalizeHookPayload|lastStatusByPaneKey|transportPayload' \
  | head -180

Repository: stablyai/orca

Length of output: 19407


Preserve blocked until approval resolution.

The OMP normalizer maps tool_approval_requested to blocked and a later agent_end to done, with no latch. Add a latch and a regression test for request → agent_end → unresolved approval.

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.

2 participants