Skip to content

feat(install): requires_privileges and missing_tool carry the vendor's steps - #311

Merged
xxchan merged 1 commit into
mainfrom
feat/install-unsupported-steps
Oct 10, 2026
Merged

xxchan merged 1 commit into
mainfrom
feat/install-unsupported-steps

Conversation

@xxchan

@xxchan xxchan commented Oct 10, 2026

Copy link
Copy Markdown
Member

What

InstallUnsupported gains two optional fields, set only where oar knows the vendor's step but will not run it here (requires_privileges and missing_tool, from scriptInstallPlanOn):

export interface InstallUnsupported {
  readonly kind: "unsupported";
  readonly reason: InstallUnsupportedReason;
  readonly detail?: string;
  /** The steps the plan would have had, for a person to run themselves once they have what is missing; oar runs none of them. */
  readonly steps?: readonly InstallStep[];
  /** The vendor's page that documents `steps` (the plan's `source`). */
  readonly source?: string;
}
  • steps are exactly the plan's steps (command, and display: the vendor's documented line), and source is the plan's source.
  • platform, requires_gui, bundled, line_required and unknown_line carry neither.
  • install() already returns the plan's unsupported answer 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), or curl/bash is missing, oar answers unsupported and 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

  • Contract comments in src/contracts/install.ts.
  • docs/spec/install.md: the Plan section, the unsupported row of the install results and both reason rows.
  • The packages/oar README install paragraph.

This repo keeps no CHANGELOG; release notes go in the release PR.

Test

  • tests/install.test.ts: with an injected InstallHost, missing_tool and requires_privileges deep-equal { kind, reason, detail, steps, source }, where steps and source are those of the plan on the unblocked host. The platform answers (win32, freebsd, ia32) have no steps or source. planInstaller passes an unsupported answer with steps through unchanged and runs nothing.
  • tests/install-runtimes.test.ts: kimi with KIMI_INSTALL_DIR=/usr/local is requires_privileges and still carries kimi's documented line and source. opencode's line_required and unknown_line carry neither.
  • I checked that the new assertions fail without the source change.
  • CI=1 pnpm run check passed (1507 tests, mock sea-trial 19/19 clean), and so did pnpm run build. No installer ran and nothing was downloaded.

🤖 Generated with Claude Code

…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]>
@xxchan
xxchan merged commit 4ac48a5 into main Oct 10, 2026
17 checks passed
@xxchan
xxchan deleted the feat/install-unsupported-steps branch October 10, 2026 06:32
@xxchan xxchan mentioned this pull request Oct 10, 2026
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]>
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