Skip to content

Agent status C4: install hooks where the agent actually runs - #21057

Closed
brennanb2025 wants to merge 14 commits into
mainfrom
brennanb2025/agent-status-c4-integrations
Closed

brennanb2025 wants to merge 14 commits into
mainfrom
brennanb2025/agent-status-c4-integrations

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Orca can install an agent's status hook in one place while launching that agent with a different operating system, profile, shell, or account. The result is a hook that looks installed but never reports status. This draft makes installation, launch settings, delivery evidence, and account selection describe the same launched environment.

Files Added Deleted Net
Test 34 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1170 $\color{#cf222e}{\Huge{\mathbf{−}}}$​221 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​949
Prod 79 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2502 $\color{#cf222e}{\Huge{\mathbf{−}}}$​417 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2085

Before / After

Before: separate install and cleanup lists could drift; remote launches often fell back to a default profile; a hook file could be treated as healthy without proof that the vendor loaded it or delivered an event; and changing the selected Claude account could sound as though an already-running process had switched credentials.

After at b63527cb2e85ea91b1ca4b75cf2d75c794b6746d: managed hooks and plugins are described by one lifecycle, explicit profiles and the selected shell are carried into local/SSH/WSL launch setup, the supported OpenCode loader and Auggie path have real event receipts, hook input and HTTP payloads are bounded, and Claude account changes explicitly apply to future launches while current processes keep their original binding. These paths are implemented and locally tested, but the latest corrections have not received a fresh independent review or current-head manual QA.

Issue records

No issue is auto-closed by this draft. The code directly targets these records, but real vendor/platform acceptance and final review are still required:

The following records are only partially addressed or remain open in this area:

  • STA-7369: the inspected, supported OpenCode loader path is implemented; a future 2.x loader API is deliberately not claimed without a verified contract.
  • STA-3939, STA-7351, and STA-4864: the shared lifecycle reduces drift, but these vendor-specific outcomes still need acceptance against the real tools; this PR does not by itself complete the requested Claude plugin migration.
  • STA-7177: the UI and API now say future launches only; switching credentials inside an already-running Claude process is not implemented.

These records belong to other status mechanisms and are still open: STA-3487, STA-4710, and STA-3149 need turn/session recovery; STA-7379 needs interaction-versus-completion handling; STA-7440 needs readiness work; and STA-2864 needs host-to-client status publication.

Why this approach

The lifecycle is derived from one integration description and runs on the host that actually launches the agent. That keeps installation, refresh, removal, and event delivery tied to the same profile and environment. Loader and delivery receipts expire or are invalidated, so an old file cannot remain a permanent promise that status still works.

The main alternatives were keeping separate operation lists, resolving everything from the Orca process's default home, treating file presence as runtime health, or changing one global account setting and implying that live processes changed too. Those approaches can describe a different environment than the one running the agent or preserve stale bookkeeping. This PR instead carries the launch choices to the existing host-side lifecycle and describes account changes honestly as future-launch selection.

Scope, dependencies, and remaining work

This is the integration layer, not the whole status repair. C1/C2 own turn completion and recovery, C3 owns readiness, C5 supplies durable execution identity, C10 supplies committed membership, and C7 owns host-to-client publication. The earlier C5 foundation overlaps the combined C5/C10 branch; do not merge both independently without reconciliation.

The branch merged an earlier origin/main during implementation. Against the current fetched origin/main at 36cdb34097a7075718abe41c29d559101841166a (which descends from the coordinator's 383c543e0f6651a6c2d99ecca5ab43fbedd1bee8 baseline), a local merge simulation is conflict-free, so no new merge commit was manufactured.

Still required before this can leave draft: independent review of the latest eight corrections, real provider installation and event delivery, live SSH/WSL and fish coverage, account-transition QA without altering active credentials, mixed-version remote checks, and hidden/background Electron QA where UI behavior is involved. GitHub currently reports failures in the root-directory guard, static analysis, Windows packaging, test shards 5 and 8, and the aggregate verify job; those failures have not been dismissed by this description update.

Revision-specific checks

  • 14 focused Vitest files: 161 tests passed with ORCA_BACKGROUND_LAUNCH=1.
  • Node, web, and CLI typechecks passed using the repository's project configurations.
  • Changed-file quality: 0 new findings across 105 changed files.
  • git merge-tree, git diff --check, and a conflict-marker scan were clean against the fetched baseline above.
  • No Electron window, mobile emulator, live provider install, remote host, or credential mutation was used in this pass.

Draft status

Not merge-ready. This PR was opened early at the user's request. Conflict checks and local tests do not replace the missing independent architecture review or environment QA.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review and validation handoff — 2026-09-16

Draft / not merge-ready. Published at the user's request before review/QA completion. Published head: b63527cb2e85ea91b1ca4b75cf2d75c794b6746d.

What has been done

Independent architecture review identified eight defects: loader contract, Auggie reachability, remote profile scope, health producers/persistence, cleanup matching, default profile routing, selected shell propagation and execution-account binding. Recovery commit b63527c addresses these according to the implementation report, which reports pnpm tc, changed-code quality and 290 tests in 18 focused files passing.

These are recorded worker/reviewer results from the stated revisions, not a fresh coordinator rerun, CI result, or blanket approval of today's PR head. Recovery/review workers used GPT-5.6 Sol xhigh; provider interruptions prevented some follow-up stages from finishing.

What still needs to be done

The latest recovery has NOT passed a fresh independent review. Follow-up auditing was interrupted by provider errors; verify actual loader/runtime callers, health attribution, concurrent remote profiles, immutable account binding and mixed-version RPC behavior. Real provider installation, SSH/WSL, fish and account-transition Electron QA remain; do not mutate active credentials to manufacture evidence.

Before marking ready: address proven findings, reconcile current main and cross-batch overlap, complete independent review of the final diff, rerun relevant tests/typechecks/quality, and perform fresh manual Electron QA against that exact head. Use background/hidden CDP validation; unavailable auth/platform scenarios remain explicitly unverified. No successful final-head review or QA should be inferred from old report filenames or task completion labels.

Related batch PRs

C1: #21053 · C10: #21054 · C2: #21056 · C3: #21055 · C4: #21057 · C5: #21058 · C6: #21059 · C7: #21060

The remaining full-batch work stays open; opening this draft does not mark those requirements complete.

@brennanb2025 brennanb2025 changed the title Agent status C4: provider integration lifecycle and account bindings Agent status C4: install hooks where the agent actually runs Sep 16, 2026
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Conflict and description follow-up for b63527cb2e85ea91b1ca4b75cf2d75c794b6746d:

  • Integration baseline: current fetched origin/main 36cdb34097a7075718abe41c29d559101841166a, a descendant of the coordinator baseline 383c543e0f6651a6c2d99ecca5ab43fbedd1bee8.
  • Conflicts: none. git merge-tree completed cleanly, so there were no conflict files or manual resolution decisions and no unnecessary merge commit was added.
  • Fresh checks: 14 focused Vitest files / 161 tests passed; node, web, and CLI typechecks passed with the repository project configurations; changed-file quality reported 0 new findings across 105 changed files; git diff --check and the conflict-marker scan were clean. All test commands used ORCA_BACKGROUND_LAUNCH=1.
  • Remaining blockers: the latest eight corrections still need independent re-review. Real provider installs and event delivery, SSH/WSL/fish coverage, mixed-version remote behavior, and account-transition/background Electron QA remain unverified; no active credentials were changed. GitHub also still reports failures in the root-directory guard, static analysis, Windows packaging, test shards 5 and 8, and the aggregate verify job.

The PR remains a draft. The rewritten description separates what this revision implements from issue records that are only partial, routed elsewhere, or still open.

Three OpenCode status regressions traced to one mechanism: a delivery
receipt was recorded before the status disposition, and its argument
evaluated dirname(lastStatusFilePath!) outside the receipt helper's own
try/catch. That path is null until the endpoint is set up and again
after stop(), so the throw dropped every OpenCode/Auggie hook before it
could reach applyNormalizedStatus. Record the receipt after status is
applied and only when the path exists.

The OpenCode launch path had the same shape: a health write sat inside
the overlay try/catch, so a failed write fell back to the user's config
without the status plugin. Move it behind a helper that cannot throw.

Also give the child-process owner module the return type of its own
spawnProcess, so naming a spawned handle no longer requires importing
node:child_process. Migrates four WSL relay files off the direct import
and lowers the guard pin 155 -> 152.

Merges two duplicate imports flagged by the native-plugin quality gate,
and untracks three root-level report files that the root directory
guard rejects.
The selected-shell test asserted against whatever XDG_CONFIG_HOME the
developer's machine exported. readSessionShellStartupEnvVar falls back
to the main process value when the session env omits one, so the fish
config resolved against Orca's own config root: it passed where that
variable is unset and failed on CI where it is set. Pass the variable
explicitly instead. The production fallback is unchanged and still
covered by its own test.

Adds a contract test that a broken integration-health directory does
not cost the user the OpenCode plugin, and syncs the localization
catalog for the account-selection strings this branch added.
The managed Codex hook now answers with `{}` on every path, POSIX and
Windows alike. The POSIX test was updated with that change; this one
was not, because it is skipped off Windows and only runs inside the
packaging job, so a local suite run stays green either way.

Expect the neutral reply where the script actually runs. The
script-removed case keeps an empty stdout: the echo cannot run when
the script is gone.
An independent review found the same defect I had fixed in the local
hook server still live in the relay: the receipt ran before applyEvent
with its path joined in the argument list, outside the helper's guard.
Guarding each call site is the wrong shape, so the receipt now takes
the endpoint directory and owns the null check and the join. Both
callers are safe by construction and the relay records after ingestion.

Guards the Auggie install receipt too. getAppEnvironment() throws by
contract outside an installed environment, so an unguarded diagnostics
write could report a completed install as failed; remove() already had
this guard, install() did not.

Clears the ambient variables the OMP resolver falls back to in the
launch-scope tests, so an exported OMP_PROFILE or XDG_CONFIG_HOME can
no longer steer them, and skips the two startup-file probe cases on
Windows, where the probe is unsupported and returns nothing.
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Closing this draft from the September 14 agent-status plan. That plan was re-examined against current main and replaced.

This branch conflicts with main, and its central work duplicated contracts that had already merged (the canonical status store and the child-work contract landed on 15–16 September). The replacement work is being done as smaller root-cause PRs, each planned, challenged and reviewed first.

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