Repository navigation
feat(install): requires_privileges and missing_tool carry the vendor's steps - #311
Merged
Merged
Conversation
…s steps When a script installer writes somewhere this user cannot, or needs a tool that is not on PATH, installPlan() and install() answer `unsupported` and drop the vendor's step. oar knows the documented command in both cases; it just will not run it here. A host still has to tell the person "run this yourself, with the rights it needs" (or "after installing curl") and show the exact command, and could not get it from oar's answer. InstallUnsupported gains two optional fields, set only on those two reasons from scriptInstallPlanOn: - `steps?: readonly InstallStep[]`: exactly the steps the plan would have had (`command`, and `display`: the vendor's documented line). oar runs none of them. - `source?: string`: the vendor's page that documents the method, the plan's `source`. `platform`, `requires_gui`, `bundled`, `line_required` and `unknown_line` carry neither. install() returns the plan's unsupported answer unchanged, so it carries them too. Documented in the contract comments, docs/spec/install.md and the package README. Unit tests pin both reasons to the plan's steps and source through the injectable InstallHost, check that platform, line_required and unknown_line carry neither, and that install() passes the fields through without running anything. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
xxchan
added a commit
that referenced
this pull request
Oct 10, 2026
Release OAR and CLI 0.53.0. This PR changes only the two package version fields. **Fixed: a host prompt gets its own answer on claude** (#308, #313) - A host prompt sent while claude is busy (for example as a background task finishes) can wait behind a turn claude starts on its own. OAR used to end the prompt at that other turn's result and hand the host the wrong text. claude now reports each prompt's own `command_lifecycle` (`queued`, then `started`), and OAR attributes the turn by it: - `input_queued { inputId }` (new) means claude holds the input and has not started its turn; - `turn_active` gains an optional `inputId` for the input whose turn claude started; - a turn without that id while the prompt waits is a separate turn. `promptAndWait`, `awaitTurnEnd(…, inputId)`, `awaitIdle`, `statusOf` and the session view all follow this, live and on replay. An ordinary prompt shows no change: no idle flicker and no moved bubble. - `promptAndWait` now sends a fresh UUID `inputId` when the caller gives none. `awaitTurnEnd` takes an optional `inputId`. - **`abort()` while a host prompt is still queued** sends claude's interrupt with `cancel_queued` (when claude declares `interrupt_cancel_queued_v1`). The queued prompt is cancelled with the running turn, and `input_dropped { reason: "turn_interrupted" }` hands it back. Cost: claude also drops queued task notifications that have no id. - **A reused `inputId`:** claude ignores a user message whose id it has already seen. OAR used to wait until the abort fallback killed the process. Now `input_dropped { reason: "runtime_refused", failure: "invalid_request", message }` is emitted at once and the session takes the next prompt. Resend a dropped input with a **new** `inputId` on claude. **Added: claude workflow runs are tasks** (#305, #307) - Claude Code's local workflows (`local_workflow`) are reported as `TaskType` `"workflow"`, and agent teammates (`in_process_teammate`) as `"agent"`. A changed `task_progress.description` becomes `task_updated`. The phase and agent list (`workflow_progress`) stays in the native frame only, because it is outside claude's SDK schema. A workflow's spend appears in a later `result.modelUsage`. - A turn claude starts on its own (after a workflow, a queued message, a late steer) now emits `turn_active` at once, so the host does not show idle until text arrives. **Fixed: claude sessions no longer inherit a parent Claude Code session's markers** (#303, #307, #309, #310) - A host started from inside Claude Code passed that session's markers to every claude OAR started. The worst cases: `CLAUDE_CODE_CHILD_SESSION`, which made claude treat itself as part of the parent session; an inherited `CLAUDE_CODE_ENTRYPOINT`, which made an API-key session fail with "Not logged in"; and the parent's `CLAUDE_CODE_MESSAGING_TOKEN`. Sessions and the claude subcommands OAR runs (auth, login, logout, usage, model list, inventory, `claude update`) now drop the twelve markers claude itself drops when it launches an independent claude. An explicit `SessionOptions.env` value still wins, except `CLAUDECODE`. - A `compaction_ended` received while idle leaves status idle. **Added: install steps when OAR won't run them** (#311) - `requires_privileges` and `missing_tool` answers now carry the vendor's `steps` and `source`, for a person to run once they have the rights or the tool. OAR runs none of them. **Behavior changes** - New event kinds `input_queued`, plus optional fields on `turn_active` (`inputId`) and `input_dropped` (`failure`, `message`, only with `runtime_refused`). Hosts with an exhaustive `switch` need the new case. - `TaskType` gains `"workflow"`. - `promptAndWait` always sends an `inputId`, so the input's identity in `ConversationInput` is that id, not the request id. - On claude, resend a dropped input with a new `inputId`. Validation: every PR passed all 17 checks on its final head. #307 differed from its CI tree only in the version fields from the 0.52.0 release. #311 was verified locally on top of #310 (typecheck, lint, full tests), and its merged tree equals that verified tree. #310 and #313 merged with trees equal to their CI trees. Lookout verified each against the real claude CLI with a mock provider, with no account: three workflow recordings, the environment of every claude process, and more than a dozen lifecycle recordings for #313 (collision, steer, queue, cancel before and after start, plain interrupt, fold-in, duplicate after drop and after resume). After this PR passes CI and merges, tag its exact squash commit as `v0.53.0` to trigger npm trusted publishing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: exe.dev user <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
InstallUnsupportedgains two optional fields, set only where oar knows the vendor's step but will not run it here (requires_privilegesandmissing_tool, fromscriptInstallPlanOn):stepsare exactly the plan's steps (command, anddisplay: the vendor's documented line), andsourceis the plan'ssource.platform,requires_gui,bundled,line_requiredandunknown_linecarry neither.install()already returns the plan'sunsupportedanswer unchanged, so it carries them too.Why
When the installer would write a directory this user cannot write (an install location variable naming
/usr/local, say), orcurl/bashis missing, oar answersunsupportedand drops the vendor's command. A host still needs to tell the person "oar can't install it here; run this yourself, with the rights it needs" (or "after installing curl") and show the exact documented command. It could not get that command from oar's answer.Docs
src/contracts/install.ts.docs/spec/install.md: the Plan section, theunsupportedrow of the install results and both reason rows.packages/oarREADME install paragraph.This repo keeps no CHANGELOG; release notes go in the release PR.
Test
tests/install.test.ts: with an injectedInstallHost,missing_toolandrequires_privilegesdeep-equal{ kind, reason, detail, steps, source }, wherestepsandsourceare those of the plan on the unblocked host. Theplatformanswers (win32, freebsd, ia32) have nostepsorsource.planInstallerpasses an unsupported answer with steps through unchanged and runs nothing.tests/install-runtimes.test.ts: kimi withKIMI_INSTALL_DIR=/usr/localisrequires_privilegesand still carries kimi's documented line and source. opencode'sline_requiredandunknown_linecarry neither.CI=1 pnpm run checkpassed (1507 tests, mock sea-trial 19/19 clean), and so didpnpm run build. No installer ran and nothing was downloaded.🤖 Generated with Claude Code