Skip to content

feat(cli): show orca search now the settings toggle ships - #20677

Merged
Jinwoo-H merged 15 commits into
mainfrom
session-search-unhide-cli
Sep 16, 2026
Merged

Jinwoo-H merged 15 commits into
mainfrom
session-search-unhide-cli

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14 $\color{#cf222e}{\Huge{\mathbf{−}}}$​14 0
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​35 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​30

Restores the three discovery surfaces that PR #20514 removed while the settings toggle was still in flight.

  • Drops hidden: true from the orca search spec, so the command is back in agent-context --json and in unknown-command suggestions.
  • Restores the Agent Sessions: block in the root help and the two orca search … usage lines in the common-commands list, byte-for-byte as they were.
  • Flips the discovery-surface tests back to asserting presence, and keeps the --help and dispatch cases. The buildAgentContext hidden-spec filter and its test stay, because they correctly hide terminal stop.

Gates:

ORCA_BACKGROUND_LAUNCH=1 pnpm tc
ORCA_BACKGROUND_LAUNCH=1 pnpm tc:cli
ORCA_BACKGROUND_LAUNCH=1 pnpm test src/cli
ORCA_BACKGROUND_LAUNCH=1 pnpm run check:code-quality:changed
ORCA_BACKGROUND_LAUNCH=1 pnpm build:cli

All five pass. pnpm test src/cli reports 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, not main. It should merge only after PR 8 (#20582) lands, since that is the PR shipping the settings toggle this command depends on.

`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

pullfrog Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

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.

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ 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 search discovery — dropped hidden: true so the command returns to agent-context --json, the root help, and unknown-command suggestions.
  • Re-added root help text — the Agent Sessions: primary block and the two orca search … common-command usage lines.
  • Flipped discovery tests — assertions now expect presence instead of absence; the --help and dispatch cases are retained.
  • Documented the command in the shipped guide — new ## Agent Session Search section in skill-guides/orca-cli.md, with the generated bundled-skill-guides.ts copy regenerated (node config/scripts/generate-bundled-skill-guides.mjs verifies clean).

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread skill-guides/orca-cli.md Outdated

## 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ 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 commands code block, and a Search rules bullet list, matching the structure of the sibling command sections.
  • Regenerated the bundled guide — src/cli/bundled-skill-guides.ts refreshed; node config/scripts/generate-bundled-skill-guides.mjs reproduces a clean tree.
  • No new claims introduced — the rules and examples cross-check against src/cli/specs/search.ts and the search contract; the earlier concern about resumeCommand survives the rewrite, re-anchored inline below.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread skill-guides/orca-cli.md
- 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

@Jinwoo-H
Jinwoo-H changed the base branch from session-search-pr6-cli to main September 16, 2026 16:15
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

📝 Walkthrough

Walkthrough

The search command is no longer marked hidden. It now appears in primary and secondary root help, command resolution, agent discovery, and command suggestions. Tests verify these discovery surfaces and command-specific help. The CLI guide documents agent session search scope, options, matching behavior, settings requirements, indexing status, result fields, and snippet handling.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 49473

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)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change, rationale, scope, dependency on PR #20582, and validation results. However, it omits required template sections, including the Linked Issue entry, Visual Proof or … Complete the required template sections. Add the linked issue using Fixes #...; add Visual Proof or write N/A with a reason; complete the Testing checklist; provide AI Disclosure information when applicable; complete Review, Agent skill…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies the CLI change: showing orca search after the settings toggle ships. The wording is somewhat awkward, but it clearly relates to the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the change, rationale, scope, dependency on PR #20582, and validation results. However, it omits required template sections, including the Linked Issue entry, Visual Proof or an explicit N/A explanation, checklist confirmations, AI Disclosure, Review, Agent skill upstream boundary, and Notes.

Resolution

Complete the required template sections. Add the linked issue using Fixes #...; add Visual Proof or write N/A with a reason; complete the Testing checklist; provide AI Disclosure information when applicable; complete Review, Agent skill upstream boundary, Notes, and the remaining Checklist items.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 2173ecd3-ad56-40a8-b180-2f54a0dc7e83

📥 Commits

Reviewing files that changed from the base of the PR and between a7e34d5 and 4947350.

📒 Files selected for processing (6)
  • skill-guides/orca-cli.md
  • src/cli/bundled-skill-guides.ts
  • src/cli/root-help-text-primary.ts
  • src/cli/root-help-text-secondary.ts
  • src/cli/specs/search.test.ts
  • src/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.

Comment thread skill-guides/orca-cli.md

## 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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

@Jinwoo-H
Jinwoo-H merged commit 3631a1e into main Sep 16, 2026
33 checks passed
ivanvykopal pushed a commit to ivanvykopal/orca that referenced this pull request Sep 20, 2026
…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
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