Skip to content

feat: add Qoder CLI (qodercli) as a supported TuiAgent - #15291

Closed
adlternative wants to merge 2 commits into
stablyai:mainfrom
adlternative:adlternative/investigate-qodercli-detection
Closed

adlternative wants to merge 2 commits into
stablyai:mainfrom
adlternative:adlternative/investigate-qodercli-detection

Conversation

@adlternative

Copy link
Copy Markdown
Contributor

Summary

Add first-class support for Qoder CLI as an Orca TuiAgent.

What's included

Core agent support (src/shared/)

  • TuiAgent union + TUI_AGENT_CONFIG with qodercli detection, --prompt-interactive flag injection, and --permission-mode bypass_permissions yolo flag
  • Agent process recognition (name + versioned binary prefix qodercli-<version>)
  • Display name, telemetry agent kind, skills CLI key mapping, and agent picker catalog entry
  • Auto-pick order placement

Trust preflight (src/main/agent-trust-presets.ts)

  • Qoder CLI uses a workspace-local .trusted marker to skip its first-launch "Trust folder" menu
  • Pre-write the marker at workspace creation, both local and remote (SSH)

Hook integration for status tracking + session resume (src/main/qoder/hook-service.ts — new)

  • QoderHookService with Claude-compatible hook events (SessionStart, UserPromptSubmit, Stop, PreToolUse, PostToolUse, PostToolUseFailure)
  • Managed hook install/remove/status/remote-SSH, registered in the managed-agent-hook-registry and remote-hook-service-installers
  • AgentHookSource + AgentHookTarget registration; normalizer dispatch reuses the existing Claude normalizer
  • ResumableTuiAgent + session extraction + --resume argv construction
  • Hook-service test suite (user hook preservation, stale sweep, removal)

Verification

  • TypeScript typecheck: node / cli / web pass (no new errors)
  • Test suites: 85+ tests pass across agent-hooks, agent-trust, session-resume, hook-listener, qoder hook-service
  • End-to-end: orca skills install --dry-run emits --agent qoder; real install writes to ~/.qoder/skills/

@coderabbitai

coderabbitai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7396d55a-cfe0-489c-ad41-abcf8399270d

📥 Commits

Reviewing files that changed from the base of the PR and between 6e8da1d and 0d8c2f7.

📒 Files selected for processing (27)
  • src/main/agent-hooks/managed-agent-hook-registry.ts
  • src/main/agent-hooks/remote-hook-service-installers.test.ts
  • src/main/agent-hooks/remote-managed-hook-installers.ts
  • src/main/agent-trust-presets.ts
  • src/main/ipc/agent-trust.ts
  • src/main/ipc/worktree-remote.ts
  • src/main/qoder/hook-service.test.ts
  • src/main/qoder/hook-service.ts
  • src/main/remote-agent-trust-presets.ts
  • src/main/runtime/orca-runtime.ts
  • src/preload/api/agent-status-api.ts
  • src/renderer/src/lib/agent-catalog.tsx
  • src/renderer/src/lib/agent-status.ts
  • src/shared/agent-hook-listener.ts
  • src/shared/agent-hook-relay.ts
  • src/shared/agent-hook-types.ts
  • src/shared/agent-kind.ts
  • src/shared/agent-process-recognition.ts
  • src/shared/agent-session-resume.ts
  • src/shared/agent-type-label.ts
  • src/shared/skills-cli-agent-keys.ts
  • src/shared/telemetry-events.ts
  • src/shared/tui-agent-config.ts
  • src/shared/tui-agent-display-names.ts
  • src/shared/tui-agent-permissions.ts
  • src/shared/tui-agent-selection.ts
  • src/shared/tui-agent.ts

📝 Walkthrough

Walkthrough

Added Qoder as a supported TUI agent with CLI configuration, detection, permissions, selection, telemetry, labels, catalog metadata, and session resume support. Added local and remote workspace trust handling. Added Claude-compatible Qoder hook processing, managed hook installation, remote installation, removal, status reporting, and tests.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the implementation and verification, but it omits required template sections, the linked issue, visual proof or N/A, and checklist details. Use the repository template and add ELI5, What Changed, Why, Linked Issue, Visual Proof or N/A, Testing checkboxes, AI Disclosure, Review, Notes, and Checklist sections.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the primary change: adding Qoder CLI as a supported TuiAgent.

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: 8

🧹 Nitpick comments (2)
src/main/qoder/hook-service.ts (2)

30-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Shorten the Qoder compatibility comment.

The event list already states the supported events. Keep one brief comment only for information not expressed by QODER_EVENTS.

As per coding guidelines: “Comments must be concise, non-obvious, and brief—prefer one line; do not explain obvious behavior or walk through code.”

Source: Coding guidelines


212-213: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Build remote POSIX paths with path.posix.join.

Use path.posix.join(remoteHome, '.qoder', 'settings.json') and the equivalent script path to normalize trailing separators and avoid malformed paths.

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5d4be6f2-73ac-4d28-a6ea-25e29544350a

📥 Commits

Reviewing files that changed from the base of the PR and between 6e8da1d and 407b6a7.

📒 Files selected for processing (27)
  • src/main/agent-hooks/managed-agent-hook-registry.ts
  • src/main/agent-hooks/remote-hook-service-installers.test.ts
  • src/main/agent-hooks/remote-managed-hook-installers.ts
  • src/main/agent-trust-presets.ts
  • src/main/ipc/agent-trust.ts
  • src/main/ipc/worktree-remote.ts
  • src/main/qoder/hook-service.test.ts
  • src/main/qoder/hook-service.ts
  • src/main/remote-agent-trust-presets.ts
  • src/main/runtime/orca-runtime.ts
  • src/preload/api/agent-status-api.ts
  • src/renderer/src/lib/agent-catalog.tsx
  • src/renderer/src/lib/agent-status.ts
  • src/shared/agent-hook-listener.ts
  • src/shared/agent-hook-relay.ts
  • src/shared/agent-hook-types.ts
  • src/shared/agent-kind.ts
  • src/shared/agent-process-recognition.ts
  • src/shared/agent-session-resume.ts
  • src/shared/agent-type-label.ts
  • src/shared/skills-cli-agent-keys.ts
  • src/shared/telemetry-events.ts
  • src/shared/tui-agent-config.ts
  • src/shared/tui-agent-display-names.ts
  • src/shared/tui-agent-permissions.ts
  • src/shared/tui-agent-selection.ts
  • src/shared/tui-agent.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review.

Comment thread src/main/qoder/hook-service.test.ts Resolved
Comment thread src/main/qoder/hook-service.test.ts Resolved
Comment thread src/main/qoder/hook-service.ts Resolved
Comment thread src/main/remote-agent-trust-presets.ts Resolved
Comment thread src/main/remote-agent-trust-presets.ts Resolved
Comment thread src/shared/agent-hook-listener.ts Resolved
Comment thread src/shared/agent-process-recognition.ts Resolved
@adlternative

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@adlternative

Copy link
Copy Markdown
Contributor Author

@coderabbitai summary

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Summary regeneration triggered.

@adlternative

Copy link
Copy Markdown
Contributor Author

All 7 CodeRabbit issues addressed (commit 0d8c2f7)

# Severity Issue Fix
1 🟠 Major agent-process-recognition.ts — PROCESS_TO_AGENT.get('qoder') key not found (registered as qodercli) ✅ Changed to get('qodercli')
2 🟠 Major agent-hook-listener.ts — Qoder hooks emit agentType: 'claude' ✅ Parameterized source on buildClaudeStatusPayload, normalizeClaudeEvent, buildClaudeCachedLeadStatusPayload (default 'claude'), Qoder passes 'qoder'
3 🟠 Major hook-service.ts Windows — exit /b 0 before stdin drain ✅ Moved after buildWindowsHookStdinDrainEpilogue()
4 🟠 Major remote-agent-trust-presets.ts — Qoder trust blocked by home resolution guard ✅ Qoder branch dispatched before home resolution (only needs fsProvider)
5 🟠 Major remote-agent-trust-presets.ts — raw path join + overwrites existing marker ✅ path.posix.join + stat no-clobber check
6 🟡 Minor hook-service.test.ts — vi.mock('os') doesn't match node:os import ✅ Changed to vi.mock('node:os')
7 🟡 Minor hook-service.test.ts — remove test depends on prior test's fixture ✅ Self-contained fixture with its own settings.json

Verification

  • Typecheck: node / cli / web — all clean (only pre-existing TabBarCreateEntry error)
  • Tests: qoder hook-service (3) + remote-hook-service-installers (24) + agent-hook-listener + agent-trust-presets — all green
  • Other agents (claude/codex/grok) unaffected — source parameter defaults to 'claude'

himichaelroberts added a commit to himichaelroberts/orca that referenced this pull request Sep 3, 2026
`spawnLocalStartupAndSetupTerminals` in ipc/worktree-remote.ts had its own
per-preset chain with cursor/copilot/codex arms and no default, so a preset
added later — `claude` — resolved from TUI_AGENT_CONFIG, matched nothing, and
silently wrote no trust artifact on that launch path. The `satisfies
Record<AgentTrustPreset, …>` guard added earlier cannot catch this: it proves
the map is complete, not that no hand-rolled chain exists elsewhere.

Found while reading stablyai#15291, which adds a `qoder` arm to this same chain.

Also awaits the write. The old chain called `markCodexProjectTrusted` without
awaiting inside a sync `if`, so `runtime.createTerminal` immediately below
could boot the agent before trust landed — the same race fixed in the IPC
handler earlier in this branch.

Exhaustively checked for other chains: the six renderer call sites all go
through the IPC bridge, `runtime-worktree-agent-startup` has the two already
consolidated, and the direct `markCodexProjectTrusted` calls in
codex-launch-preparation.ts and codex-session-resume-launch.ts are
Codex-specific launch paths that never read `preflightTrust`. This was the last
one.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@himichaelroberts

himichaelroberts commented Sep 4, 2026 •

Copy link
Copy Markdown

Edited: I originally framed this around a merge-order overlap with #18084. That PR is now closed, so the overlap is moot — but one finding in it is still worth passing on, and it is about a file this PR touches.

You add a qoder arm to the per-preset chain in ipc/worktree-remote.ts (spawnLocalStartupAndSetupTerminals). That chain has two hazards I hit directly:

  1. No default arm. I added a claude preset to TUI_AGENT_CONFIG, it resolved fine there, matched none of the cursor/copilot/codex arms, and silently wrote no trust artifact on that launch path — no error, agent just sits on its trust prompt. Your qoder arm is therefore load-bearing; if it is ever missed on a new path the failure is silent.
  2. The write is not awaited. markCodexProjectTrusted returns a promise and that chain called it bare, with runtime.createTerminal immediately below — so the agent can boot before trust lands. Worth awaiting yours.

Note there are three separate hand-rolled preset chains in the tree (this one, registerAgentTrustHandlers, and markLocalWorktreeTrusted); the six renderer call sites all funnel through the IPC bridge. I only found the worktree-remote.ts one by reading this PR's diff, having already "consolidated" the other two — so it is easy to miss.

Separately, and only in case it has not come up: #8611 adds the same agent (Eridanus117, opened 2026-07-13; this one 2026-08-18). Both still open, neither referencing the other. One for the maintainers rather than either of us.

Apologies for the churn on the original version of this comment.

@Yuanxiangz

Copy link
Copy Markdown

Not merged yet?

@nwparker nwparker mentioned this pull request Sep 28, 2026
8 of 9 tasks
@nwparker

Copy link
Copy Markdown
Contributor

Cross-reviewed this proposal while consolidating Qoder support in #23581.

The consolidated change adapts versioned executable recognition, trust preflight wiring, skills mapping and resume. With installed Qoder 1.1.64, a workspace .trusted file did not bypass the trust dialog; accepting it wrote permissions.trustDirectories in ~/.qoder/settings.json, which this implementation uses. It also handles permission, notification and failure events.

Your contribution is credited with a Co-authored-by trailer in f2b5c1c and linked in the PR comparison table. Live macOS verification includes Qoder identity and the left-sidebar failure state; successful model/tool execution remains unverified because the available account has exhausted its credits.

nwparker added a commit that referenced this pull request Sep 28, 2026
feat: add first-class Qoder CLI support

Integrate Qoder launch, identity, canonical hook status, trust and resume.
Verify with captured Qoder 1.1.64 transcripts and hidden Electron sidebar checks.

Builds on and cross-reviews #7502, #8611, #9655, #12910, #13311 and #15291.

Co-authored-by: dalveytech-vincent <[email protected]>
Co-authored-by: Eridanus117 <[email protected]>
Co-authored-by: xingqingzzp-gif <[email protected]>
Co-authored-by: jyang2004 <[email protected]>
Co-authored-by: yunqian <[email protected]>
Co-authored-by: huzhening.hzn <[email protected]>
@nwparker

Copy link
Copy Markdown
Contributor

Superseded by merged #23581, which consolidates Qoder support with launch, canonical sidebar status, trust, and resume integration. Cross-reviewed this proposal and preserved its author in the squash commit co-author credits. Thank you for the contribution. Verification details and remaining live-Qoder limitations are documented in #23581.

@nwparker nwparker closed this Sep 28, 2026
@adlternative

Copy link
Copy Markdown
Contributor Author

Thanks everyone for your help — I'd left this PR unattended for way too long and it got forgotten in a corner, but I'm glad it's been resolved.

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.

4 participants