Repository navigation
feat(cli): show orca search now the settings toggle ships - #20677
Conversation
`orca search <query>` calls PR 5's `aiVault.searchSessions` over the CLI's existing runtime RPC, against the host `--environment` / `--pairing-code` selects and no other. `orca search --index-status` calls `aiVault.searchStatus`. It is the proof the contract works with no panel. Every flag maps onto a contract field and nothing else: `--scope`, `--fresh`, `--limit`, `--cursor`, repeatable `--agent` and `--path`, `--since`, `--sort`, `--debug`, `--json`. No fan-out, no merged output, no `--host`. One command rather than a `search status` subcommand: the query is a bare positional, so `orca search status` could not be told apart from searching for the word "status". `--status` is unavailable because `orchestration task-list --status <state>` already owns the name as a valued flag. No new runtime capability. PR 5 decided an explicit `method_not_found` refusal maps to `unavailable/no-service`, so reusing `createSessionSearchClient` gives an old host a plain "this host runs no session search service" answer at exit 0 instead of a raw JSON-RPC error. `CommandSpec.repeatableFlags` scopes repeatability per command, because `--agent` must repeat for search and stay single-valued for `worktree create`. `help.ts` sat exactly at max-lines, so `skills-command-flag-help.ts` becomes `command-scoped-flag-help.ts` carrying both tables at the same call-site size.
…w rejects Main gained a `consistent-type-assertions: never` scan in the changed-code gate after this branch was cut, and it reported twelve assertions in the new files. The four in the argument parser were avoidable. `readEnum` now keeps the value `find` returns, which already carries the narrow type, and the agent filter goes through an `isAiVaultAgent` predicate over a `Set<string>` instead of widening the agent tuple. The test now narrows the printed envelope by shape and re-reads the printed result through `AiVaultSearchResponseSchema`, so the JSON assertions are checked rather than claimed, and the flag table is typed so its callback needs no cast. One assertion is left, for the structural fake client, with the SAFETY rationale AGENTS.md requires.
Route every host-supplied string the search formatter prints through the escape stripper, and resolve the repeatable-flag set from the command tokens ahead when a flag sits before the command.
`orca search` stays dispatchable but leaves every discovery surface: root help, group help, unknown-command suggestions, and `agent-context --json`. `buildAgentContext` did not filter hidden specs, so it also stops leaking the hidden `terminal stop`.
|
Pullfrog stalled The agent stopped emitting events for 124s and was killed by the activity-timeout watchdog. The model produced no output at all before the stall — the request was sent but nothing came back. This is usually transient; re-running often succeeds.
|
One section: what orca search covers, one host at a time, scope and narrowing flags, index status before searching, and that a human turns search on.
There was a problem hiding this comment.
ℹ️ No critical issues — one documentation-precision suggestion inline.
Reviewed changes
This re-review covered both commits on the branch (the PR has no prior pullfrog review, so the full 6-file diff was read): the discovery-surface restore and the new Agent Session Search guide section.
- Restored
orca searchdiscovery — droppedhidden: trueso the command returns toagent-context --json, the root help, and unknown-command suggestions. - Re-added root help text — the
Agent Sessions:primary block and the twoorca search …common-command usage lines. - Flipped discovery tests — assertions now expect presence instead of absence; the
--helpand dispatch cases are retained. - Documented the command in the shipped guide — new
## Agent Session Searchsection inskill-guides/orca-cli.md, with the generatedbundled-skill-guides.tscopy regenerated (node config/scripts/generate-bundled-skill-guides.mjsverifies clean).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
|
||
| ## Agent Session Search | ||
|
|
||
| `ORCA search "<text>" --json` searches the full text of past agent sessions, conversations and tool output, indexed on one Orca host: this machine, or the paired server named by `--environment` or `--pairing-code`. There is no all-computers search. Quote a multi-word query. Each hit names the session, a snippet of the matching text, and a `resumeCommand`; `--debug` adds the route the host used. |
There was a problem hiding this comment.
This promises every hit carries a resumeCommand, but the exposure contract withholds resumeCommand and source paths from relay/paired callers — the paired server this same sentence names. A search routed to --environment/--pairing-code therefore returns hits without one (and evidence can be null for operator-only matches). Worth scoping the claim to the local host, e.g. "on this machine each hit also names a resumeCommand".
There was a problem hiding this comment.
ℹ️ No critical issues — one documentation-precision suggestion inline, carried forward from the previous review.
Reviewed changes
This incremental re-review covered the docs-only delta since pullfrog's last review (4aa008a): the Agent Session Search guide section was restructured, and its generated copy regenerated.
- Reshaped the search guide section — the single dense paragraph became an intro line, a
Common commandscode block, and aSearch rulesbullet list, matching the structure of the sibling command sections. - Regenerated the bundled guide —
src/cli/bundled-skill-guides.tsrefreshed;node config/scripts/generate-bundled-skill-guides.mjsreproduces a clean tree. - No new claims introduced — the rules and examples cross-check against
src/cli/specs/search.tsand the search contract; the earlier concern aboutresumeCommandsurvives the rewrite, re-anchored inline below.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| - Quote a multi-word query; unquoted words are read as command names. | ||
| - Search for a distinctive phrase or identifier, not a description of the topic. An exact sentence matches as a phrase first, then as all of its words, then as any of them. | ||
| - `--scope all` (the default) covers conversation turns, commands, and tool output; `--scope conversation` keeps user and assistant turns only. | ||
| - Each hit carries the session, a snippet with the matched text marked, and a `resumeCommand`. `--debug` adds the route the host used. |
There was a problem hiding this comment.
This bullet still promises every hit carries a resumeCommand, but the runtime contract and this command's own --help note both say a paired server withholds resume commands and source paths. A search routed to --environment/--pairing-code therefore returns hits without one, and evidence can be null for operator-only matches. Scope the claim to a host on this machine — the sentence was reworded in this commit, but the overclaim survives the reshape.
Technical details
# Guide overclaims `resumeCommand` on paired servers
## Affected sites
- `skill-guides/orca-cli.md:214` — intro names paired server via `--environment`/`--pairing-code`
- `skill-guides/orca-cli.md:234` — "Each hit carries … a `resumeCommand`", unqualified
- `src/cli/specs/search.ts:38` — note: "Resume commands and source paths are printed only for a host on this machine; a paired server withholds them."
- `src/shared/ai-vault-search-transport.ts:13` — relay transport drops `resumeCommand`
- `src/cli/agent-session-search-format.ts:45` — `evidence` may be absent ("no text evidence for this match")
- `src/cli/bundled-skill-guides.ts` — regenerate after editing the `.md`
## Required outcome
- The hit-contents bullet must not promise a `resumeCommand` for hits returned by a paired server, and should not imply `evidence` is always present.
## Suggested approach
- Mirror the `--help` note, e.g. "Each hit carries the session and, where the host has it, a snippet and a `resumeCommand`; a paired server withholds resume commands and source paths."# Conflicts: # src/cli/help.ts
📝 WalkthroughWalkthroughThe Priority: ⬇️ Low Merge Risk: 🔵 Low · up to Users copying the documented command may receive a command-not-found error on case-sensitive systems; the impact is limited to the new usage documentation. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the change, rationale, scope, dependency on PR Resolution Complete the required template sections. Add the linked issue using
✨ Finishing Touches📝 Generate docstrings
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 2173ecd3-ad56-40a8-b180-2f54a0dc7e83
📒 Files selected for processing (6)
skill-guides/orca-cli.mdsrc/cli/bundled-skill-guides.tssrc/cli/root-help-text-primary.tssrc/cli/root-help-text-secondary.tssrc/cli/specs/search.test.tssrc/cli/specs/search.ts
💤 Files with no reviewable changes (1)
- src/cli/specs/search.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
|
|
||
| ## Agent Session Search | ||
|
|
||
| `ORCA search` runs a full-text search over the agent sessions indexed on one Orca host: this machine, or the paired server named by `--environment` or `--pairing-code`. There is no all-computers search. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use the documented CLI executable name.
The root help names the executable orca. On case-sensitive shells, ORCA search does not invoke that command. Replace ORCA search with orca search in the introduction and all examples.
Also applies to: 219-226
…0677) * feat(cli): orca search over the agent session index `orca search <query>` calls PR 5's `aiVault.searchSessions` over the CLI's existing runtime RPC, against the host `--environment` / `--pairing-code` selects and no other. `orca search --index-status` calls `aiVault.searchStatus`. It is the proof the contract works with no panel. Every flag maps onto a contract field and nothing else: `--scope`, `--fresh`, `--limit`, `--cursor`, repeatable `--agent` and `--path`, `--since`, `--sort`, `--debug`, `--json`. No fan-out, no merged output, no `--host`. One command rather than a `search status` subcommand: the query is a bare positional, so `orca search status` could not be told apart from searching for the word "status". `--status` is unavailable because `orchestration task-list --status <state>` already owns the name as a valued flag. No new runtime capability. PR 5 decided an explicit `method_not_found` refusal maps to `unavailable/no-service`, so reusing `createSessionSearchClient` gives an old host a plain "this host runs no session search service" answer at exit 0 instead of a raw JSON-RPC error. `CommandSpec.repeatableFlags` scopes repeatability per command, because `--agent` must repeat for search and stay single-valued for `worktree create`. `help.ts` sat exactly at max-lines, so `skills-command-flag-help.ts` becomes `command-scoped-flag-help.ts` carrying both tables at the same call-site size. * refactor(cli): drop the search type assertions main's casting gate now rejects Main gained a `consistent-type-assertions: never` scan in the changed-code gate after this branch was cut, and it reported twelve assertions in the new files. The four in the argument parser were avoidable. `readEnum` now keeps the value `find` returns, which already carries the narrow type, and the agent filter goes through an `isAiVaultAgent` predicate over a `Set<string>` instead of widening the agent tuple. The test now narrows the printed envelope by shape and re-reads the printed result through `AiVaultSearchResponseSchema`, so the JSON assertions are checked rather than claimed, and the flag table is typed so its callback needs no cast. One assertion is left, for the structural fake client, with the SAFETY rationale AGENTS.md requires. * fix(cli): sanitize host strings and scope pre-command repeatable flags Route every host-supplied string the search formatter prints through the escape stripper, and resolve the repeatable-flag set from the command tokens ahead when a flag sits before the command. * refactor(cli): resolve repeatable flag rules once per command * fix(cli): clarify session search availability and SSH scope * feat(cli): hide orca search until the settings toggle ships `orca search` stays dispatchable but leaves every discovery surface: root help, group help, unknown-command suggestions, and `agent-context --json`. `buildAgentContext` did not filter hidden specs, so it also stops leaking the hidden `terminal stop`. * feat(cli): show orca search now the settings toggle ships * docs(skills): teach the orca-cli guide the search command One section: what orca search covers, one host at a time, scope and narrowing flags, index status before searching, and that a human turns search on. * docs(skills): shape the search section like the other command sections

Restores the three discovery surfaces that PR #20514 removed while the settings toggle was still in flight.
hidden: truefrom theorca searchspec, so the command is back inagent-context --jsonand in unknown-command suggestions.Agent Sessions:block in the root help and the twoorca search …usage lines in the common-commands list, byte-for-byte as they were.--helpand dispatch cases. ThebuildAgentContexthidden-spec filter and its test stay, because they correctly hideterminal stop.Gates:
All five pass.
pnpm test src/clireports 128 files and 1303 tests passed; the changed-code quality gate reports 0 new findings across 22 changed files.Base: this targets
session-search-pr6-cli, the branch of #20514, notmain. It should merge only after PR 8 (#20582) lands, since that is the PR shipping the settings toggle this command depends on.