Skip to content

test: remove 20 low-value CLI and runtime tests - #34445

Merged
OrcaWin merged 1 commit into
mainfrom
test-audit-604-cli-runtime
Oct 27, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
test-audit-604-cli-runtime

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14 $\color{#cf222e}{\Huge{\mathbf{−}}}$​381 $\color{#cf222e}{\Huge{\mathbf{−}}}$​367
Prod 1 0 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1

Remove 20 low-value authored test registrations across eight CLI/runtime suites (39 → 19), including the entire resume-capability inventory suite. Drop copied config/source strings, tests of private fixture helpers, duplicate launcher/installer cases, and setup that never reaches its claimed boundary. Remove the deleted suite’s stale timing entry.

Keep installed CLI/ASAR loading, real launcher argv/environment/signal and listener cleanup, AppImage identity fences, installer ownership refusal/migration, hook render churn, shell capability negotiation, and artifact preview/retry behavior. Correct the retained stale-grant read fixture to use a text path and the producer’s complete text-result shape; PNG paths are refused by the real text producer.

Validation: formatting, lint, AST declaration/callback/wrapper checks, unit discovery and runtime routing passed using isolated static tools. The packaged-launcher alias and parameterized registrations are counted once per authored declaration. Exact flaky-pattern scans found no baseline-count change. Runtime validation is through this PR’s CI; no local tests, installs, builds, or app launches were run. No production code changes. Net 368 fewer lines.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The changes remove selected tests from the CLI and runtime suites. The terminal-artifact stale-grant test now uses /tmp/out.txt and expects a text response. The change also removes the timing entry for the deleted host-authority capability test suite.

Priority: Low

Merge Risk: Minimal · up to f8b97

The change is mergeable, but restoring focused checks for packaged skill guides, Linux serve routing, terminal parameter projection, and resume capability routing would reduce future regression risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description clearly explains the test removals, retained coverage, validation, and lack of production changes. However, it omits required template content, including the Linked Issue, Visual Proof… Add the missing template sections and information. Include an actual issue link after "Fixes #", state "N/A" with a reason for Visual Proof because there are no UI changes, complete the Testing and Checklist items, address cross-platform an…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: removing 20 low-value CLI and runtime tests.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
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: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files.

Full details: Description check

Explanation

The description clearly explains the test removals, retained coverage, validation, and lack of production changes. However, it omits required template content, including the Linked Issue, Visual Proof or an explicit N/A statement, checklist status, cross-platform impact notes, and the required testing checklist details.

Resolution

Add the missing template sections and information. Include an actual issue link after "Fixes #", state "N/A" with a reason for Visual Proof because there are no UI changes, complete the Testing and Checklist items, address cross-platform and compatibility considerations, and complete or explicitly mark the remaining required sections as applicable or not applicable.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Nitpick comments: 4
src/main/cli/packaged-cli-assets.test.ts: 2

46-130: Trivial · Maintainability & Code Quality · Quick win

Retain the packaged skill-guide contract check.

The retained test creates an ASAR directly and applies only builderConfig.asarUnpack. It does not check builderConfig.files or invoke a packaged skills get command. A future change can reinclude source Markdown while the retained tests still pass.

Suggested fix
 describe('packaged CLI assets', () => {
+  it('ships embedded skill guides with the CLI instead of source Markdown', () => {
+    expect(builderConfig.asarUnpack).toContain('out/cli/**')
+    expect(builderConfig.files).toContain('!skill-guides{,/**/*}')
+  })
+
   it('loads worktree link validation from the installed CLI', async () => {

318-346: Trivial · Functional Correctness · Quick win

Retain a focused packaged Linux serve forwarding test.

serve --recipe-json --project-root ... is a supported CLI route. The Linux launcher must pass this route to app.asar.unpacked/out/cli/index.js in Node mode. The retained --help test does not detect a regression that redirects only serve to AppRun, or changes its arguments.

Suggested fix
   itRunsUnixShell.each(unixLauncherFixtures)(
     'delivers Unix termination signals to the $name executable and releases its listener',
     async (launcherFixture) => {
       // existing test body
     }
   )
+
+  itRunsUnixShell('keeps Linux serve on the CLI entrypoint in node mode', async () => {
+    const root = await mkdtemp(join(tmpdir(), 'orca-linux-cli-serve-'))
+    try {
+      const appDir = join(root, 'Orca')
+      const resourcesDir = join(appDir, 'resources')
+      const launcherDir = join(resourcesDir, 'bin')
+      const cliDir = join(resourcesDir, 'app.asar.unpacked', 'out', 'cli')
+      const launcherPath = join(launcherDir, 'orca-ide')
+      const appRunPath = join(appDir, 'AppRun')
+      const electronPath = join(appDir, 'orca-ide')
+      const cliPath = join(cliDir, 'index.js')
+      const statePath = join(root, 'launch-state.json')
+
+      await mkdir(launcherDir, { recursive: true })
+      await mkdir(cliDir, { recursive: true })
+      await copyFile(linuxLauncherAsset, launcherPath)
+      await writeFile(cliPath, '', 'utf8')
+      await writeFile(
+        appRunPath,
+        `#!/usr/bin/env bash
+printf 'unexpected AppRun handoff\n' >&2
+exit 97
+`,
+        { encoding: 'utf8', mode: 0o755 }
+      )
+      await writeFile(
+        electronPath,
+        `#!/usr/bin/env node
+require('node:fs').writeFileSync(process.env.ORCA_TEST_LAUNCH_STATE, JSON.stringify({
+  argv: process.argv.slice(2),
+  runAsNode: process.env.ELECTRON_RUN_AS_NODE ?? null
+}))
+`,
+        { encoding: 'utf8', mode: 0o755 }
+      )
+
+      await execFileAsync(launcherPath, ['serve', '--recipe-json', '--project-root', '/tmp/repo'], {
+        env: { ...process.env, ORCA_TEST_LAUNCH_STATE: statePath }
+      })
+      const payload = JSON.parse(await readFile(statePath, 'utf8')) as {
+        argv: string[]
+        runAsNode: string | null
+      }
+      expect(payload.argv).toEqual([
+        cliPath,
+        'serve',
+        '--recipe-json',
+        '--project-root',
+        '/tmp/repo'
+      ])
+      expect(payload.runAsNode).toBe('1')
+    } finally {
+      await rm(root, { recursive: true, force: true })
+    }
+  })
 })
src/renderer/src/runtime/web-runtime-plain-terminal-create-params.test.ts: 1

9-35: Trivial · Functional Correctness · Quick win

Retain the plain-terminal parameter projection assertion.

createWebRuntimeSessionTerminalResult reaches the non-agent path and passes buildPlainCreateTerminalParams to session.tabs.createTerminal. The retained tests cover only resolveCreateTerminalShellParams, so they do not detect regressions in the builder's shell, select, or navigation projection.

Suggested fix
-const { resolveCreateTerminalShellParams } =
+const { buildPlainCreateTerminalParams, resolveCreateTerminalShellParams } =
   await import('./web-runtime-plain-terminal-create-params')
...
+  it('builds caller-selected plain terminal params with the shell pick', async () => {
+    supportsCapability.mockResolvedValue(true)
+
+    const params = await buildPlainCreateTerminalParams('env-1', {
+      worktreeId: 'repo-1::/repo',
+      shell: 'cmd.exe'
+    })
+
+    expect(params).toMatchObject({ shell: 'cmd.exe', select: true, navigation: 'caller' })
+    expect(params.command).toBeUndefined()
+  })
src/renderer/src/runtime/agent-resume-host-authority-capability.ts: 1

22-54: Trivial · Functional Correctness · Quick win

Preserve behavior coverage for every gated resume agent.

Deleting this suite removes the only exact coverage for the agent-to-capability mapping. The Record constraint checks keys and accepts any capability string. Retained routing tests cover only a subset, so a wrong value for opencode2, dsh, zcode, kiro, or hermes can compile and go undetected. That error can make an older host attempt structured resume and return invalid_argument instead of using the legacy path.

Keep the coverage as a routing matrix that asserts structured versus legacy delivery. Do not restore a flag-only inventory test.

Suggested fix
 import { RuntimeRpcCallError } from './runtime-rpc-result'
 import { runRemoteAgentSessionLaunch } from './remote-agent-session-launch'
 import { agentResumeHostAuthorityCapability } from './agent-resume-host-authority-capability'
+import {
+  AGENT_SESSION_CODEBUDDY_RESUME_RUNTIME_CAPABILITY,
+  AGENT_SESSION_CURSOR_RESUME_RUNTIME_CAPABILITY,
+  AGENT_SESSION_DSH_RESUME_RUNTIME_CAPABILITY,
+  AGENT_SESSION_HERMES_RESUME_RUNTIME_CAPABILITY,
+  AGENT_SESSION_KIMI_RESUME_RUNTIME_CAPABILITY,
+  AGENT_SESSION_KIRO_RESUME_RUNTIME_CAPABILITY,
+  AGENT_SESSION_MUSE_RESUME_RUNTIME_CAPABILITY,
+  AGENT_SESSION_OPENCODE2_RESUME_RUNTIME_CAPABILITY,
+  AGENT_SESSION_OMP_RESUME_PATH_RUNTIME_CAPABILITY,
+  AGENT_SESSION_QODER_CN_RESUME_RUNTIME_CAPABILITY,
+  AGENT_SESSION_QODER_RESUME_RUNTIME_CAPABILITY,
+  AGENT_SESSION_QWEN_CODE_RESUME_RUNTIME_CAPABILITY,
+  AGENT_SESSION_ZCODE_RESUME_RUNTIME_CAPABILITY
+} from '../../../shared/protocol-version'
+
+const gatedResumeCapabilities = [
+  { agent: 'codebuddy', capability: AGENT_SESSION_CODEBUDDY_RESUME_RUNTIME_CAPABILITY },
+  { agent: 'cursor', capability: AGENT_SESSION_CURSOR_RESUME_RUNTIME_CAPABILITY },
+  { agent: 'qoder', capability: AGENT_SESSION_QODER_RESUME_RUNTIME_CAPABILITY },
+  { agent: 'qoder-cn', capability: AGENT_SESSION_QODER_CN_RESUME_RUNTIME_CAPABILITY },
+  { agent: 'qwen-code', capability: AGENT_SESSION_QWEN_CODE_RESUME_RUNTIME_CAPABILITY },
+  { agent: 'opencode2', capability: AGENT_SESSION_OPENCODE2_RESUME_RUNTIME_CAPABILITY },
+  { agent: 'muse', capability: AGENT_SESSION_MUSE_RESUME_RUNTIME_CAPABILITY },
+  { agent: 'zcode', capability: AGENT_SESSION_ZCODE_RESUME_RUNTIME_CAPABILITY },
+  { agent: 'omp', capability: AGENT_SESSION_OMP_RESUME_PATH_RUNTIME_CAPABILITY },
+  { agent: 'kimi', capability: AGENT_SESSION_KIMI_RESUME_RUNTIME_CAPABILITY },
+  { agent: 'dsh', capability: AGENT_SESSION_DSH_RESUME_RUNTIME_CAPABILITY },
+  { agent: 'kiro', capability: AGENT_SESSION_KIRO_RESUME_RUNTIME_CAPABILITY },
+  { agent: 'hermes', capability: AGENT_SESSION_HERMES_RESUME_RUNTIME_CAPABILITY }
+] as const
@@
-  it.each(['kimi', 'muse', 'codebuddy', 'qoder', 'qoder-cn', 'qwen-code', 'cursor'] as const)(
-    'falls back to legacy when an older host lacks the %s resume capability',
-    async (agent) => {
+  it.each(gatedResumeCapabilities)(
+    'falls back to legacy when an older host lacks the $agent resume capability',
+    async ({ agent, capability }) => {
@@
-        `agent-session.${agent}-resume.v1`
+        capability
@@
-  it.each(['muse', 'codebuddy', 'qoder', 'qoder-cn', 'qwen-code'] as const)(
-    'uses host authority when the host supports %s resume',
-    async (agent) => {
+  it.each(gatedResumeCapabilities)(
+    'uses host authority when the host supports $agent resume',
+    async ({ agent, capability }) => {
@@
-        `agent-session.${agent}-resume.v1`
+        capability

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4fbf3e2c-a96a-424a-954d-d65d1c326ae3
Commits

Reviewing files that changed from the base of the PR and between beb62fe and f8b976e.

Files selected for processing: 9
  • config/scripts/ci-shard-timings.json
  • src/main/cli/cli-installer-command-conflicts.test.ts
  • src/main/cli/cli-installer-unreadable-command.test.ts
  • src/main/cli/linux-terminal-orca-cli-shim.test.ts
  • src/main/cli/packaged-cli-assets.test.ts
  • src/renderer/src/runtime/agent-resume-host-authority-capability.test.ts
  • src/renderer/src/runtime/runtime-terminal-artifact-read.test.ts
  • src/renderer/src/runtime/use-worktree-runtime-target.test.ts
  • src/renderer/src/runtime/web-runtime-plain-terminal-create-params.test.ts
Files with no reviewable changes: 6
  • src/renderer/src/runtime/agent-resume-host-authority-capability.test.ts
  • src/main/cli/cli-installer-command-conflicts.test.ts
  • src/main/cli/packaged-cli-assets.test.ts
  • src/main/cli/cli-installer-unreadable-command.test.ts
  • src/main/cli/linux-terminal-orca-cli-shim.test.ts
  • config/scripts/ci-shard-timings.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@OrcaWin
OrcaWin merged commit dc73505 into main Oct 27, 2026
33 checks passed
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