Skip to content

feat(agents): add Qoder CLI as a supported agent - #8611

Closed
Eridanus117 wants to merge 8 commits into
stablyai:mainfrom
Eridanus117:feat/qoder-cli-agent-support
Closed

Eridanus117 wants to merge 8 commits into
stablyai:mainfrom
Eridanus117:feat/qoder-cli-agent-support

Conversation

@Eridanus117

@Eridanus117 Eridanus117 commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds Qoder CLI (qodercli) as a first-class agent in Orca with full hook integration and session resume support.

Builds on #7502 by @vincent-lxc with correctness fixes, plus complete hook service and resume support.

What's included

Agent registration (from #7502, fixed):

  • TuiAgent union, launch config, display names, telemetry, permissions, auto-pick order
  • promptInjectionMode: 'stdin-after-start' — qodercli's -p flag runs in headless mode (exits on completion), so the bare TUI is launched and the prompt injected after startup. feat(agents): add Qoder CLI identity and icon support #7502 originally used 'flag-prompt-interactive' which generates a non-existent --prompt-interactive flag.
  • Display name 'Qoder CLI' — unified across all surfaces (display names, catalog, agent status, mobile, i18n, terminal title label). feat(agents): add Qoder CLI identity and icon support #7502 used 'Qoder' for most surfaces but 'Qoder CLI' for the terminal label.
  • Terminal title disambiguation — Qoder reuses Gemini OSC glyphs (✦ ◇) but is a separate product. isQoderTerminalTitle checks for a qodercli token marker and short-circuits before Gemini glyph heuristics.

Hook integration (new):

  • Full hook service (src/main/qoder/hook-service.ts) — installs managed command-type hooks into ~/.qoder/settings.json, same pattern as Claude/Grok/all other agents
  • qodercli has a native hook system (see docs) with 23 events. We register hooks for 10 of them: SessionStart, UserPromptSubmit, Stop, StopFailure, SessionEnd, PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure, Notification
  • normalizeQoderEvent in agent-hook-listener.ts — maps events to working/waiting/done states, handles Notification with notification_type (permission_prompt→waiting, idle_prompt→done), SessionStart clears turn cache
  • Reuses extractClaudeToolFields — qodercli has Claude-compatible tool_name/tool_input payload fields
  • Registered in managed-agent-hook-controls.ts (install/remove/status)
  • 'qoder' added to AGENT_HOOK_TARGETS (cascades to telemetry schema) and AgentHookSource union

Session resume (new):

  • 'qoder' added to RESUMABLE_TUI_AGENTS
  • extractAgentProviderSession: extracts session_id + transcript_path from hook payloads
  • getAgentResumeArgv: ['qodercli', '-r', id] — qodercli's documented resume flag

Key decisions

  • command type hooks (not http): all 14 existing agents in Orca use command type. The command type allows sourcing the endpoint file for live port/token (survives Orca restarts) and access to PTY env vars (ORCA_PANE_KEY, etc.). qodercli also supports native type: "http" hooks, but we chose command for consistency and the endpoint-file mechanism.
  • stdin-after-start prompt injection: qodercli's -p flag runs in headless mode that exits on completion. The bare TUI is launched and the prompt injected after startup, matching aider, devin, goose, etc.
  • Claude-compatible normalizer: qodercli's hook events use the same event names (UserPromptSubmit, Stop, PreToolUse, etc.) and payload fields as Claude Code, so normalizeQoderEvent is modeled on normalizeKimiEvent with Notification handling added.
  • --yolo permission mode: matches qodercli's documented skip-permissions flag.
  • No first-launch trust menu: no preflightTrust needed.

Files changed

Shared layer (18 files)
File Change
types.ts 'qoder' in TuiAgent union
tui-agent-config.ts launch config with stdin-after-start
tui-agent-display-names.ts display name 'Qoder CLI'
agent-kind.ts telemetry kind mapping
telemetry-events.ts 'qoder' in AGENT_KIND_VALUES
tui-agent-permissions.ts --yolo YOLO mode
tui-agent-selection.ts auto-pick order
agent-status-types.ts WellKnownAgentType
agent-name-token-match.ts qodercli token matching + isQoderTerminalTitle
agent-title-core.ts Qoder disambiguation in isGeminiTerminalTitle
gemini-terminal-title.ts Gemini title detection with Qoder exclusion (new file)
terminal-title-agent-type.ts Qoder label in getAgentLabel + TITLE_LABEL_TO_AGENT
agent-hook-types.ts 'qoder' in AGENT_HOOK_TARGETS
agent-hook-relay.ts 'qoder' in AgentHookSource
agent-hook-listener.ts pathname routing + normalizeQoderEvent + extractToolFields + isNewTurnEvent
agent-session-resume.ts RESUMABLE_TUI_AGENTS + extractAgentProviderSession + getAgentResumeArgv
agent-detection.ts resolved merge conflict with upstream refactor
Main process (2 files)
File Change
src/main/qoder/hook-service.ts new file: managed hook installer for ~/.qoder/settings.json
managed-agent-hook-controls.ts registered qoderHookService (install/remove/status)
Renderer (4 files)
File Change
agent-catalog.tsx catalog entry with qoder.com favicon
agent-status.ts icon/label wiring
qoder-title-disambiguation.test.ts new file: Qoder vs Gemini title tests
use-tab-agent.test.ts Qoder tests extracted (max-lines)
Mobile & i18n (6 files)
File Change
mobile-tui-agents.ts mobile agent list parity
5× i18n locales (en/es/ja/ko/zh) "Qoder CLI" localized label

Screenshots

No screenshots attached. The visible change adds the Qoder CLI identity, label, and icon to existing agent surfaces; it does not introduce a new layout or interaction pattern.

Testing

  • pnpm run lint — passes; reported warnings are pre-existing and outside this PR's changed files
  • pnpm run typecheck — passes
  • pnpm exec vitest run --config config/vitest.config.ts src/main/qoder/hook-service.test.ts — 2/2 tests pass for local PermissionRequest installation and remote POSIX path normalization
  • 82 existing tests pass across 6 agent identity/resume files
  • pnpm verify:localization-catalog and localization coverage checks pass
  • oxfmt --check and git diff --check pass
  • Mergeable against latest main

AI Review Report

CodeRabbit actionable findings are 3/3 addressed:

  • Register PermissionRequest in QODER_EVENTS and verify it is written to .qoder/settings.json (414a92fff).
  • Make the existing normalizeQoderEvent permission-waiting branch reachable through the installed event (414a92fff).
  • Build SSH remote paths with posix.join and cover trailing-slash normalization (bf8953d13).

CodeRabbit's generic docstring-coverage warning is not a repository gate for this TypeScript codebase. The applicable repository gates are lint, typecheck, reliability/max-lines checks, localization checks, and behavior-focused tests; all pass. Non-obvious hook and remote-path decisions retain focused rationale comments instead of duplicating function names with boilerplate docstrings.

Security Audit

  • No new external endpoint, credential flow, or secret storage is introduced.
  • Hook payloads continue to use Orca's existing localhost endpoint and token mechanism.
  • SSH installation continues to use the existing SFTP atomic-write helpers; remote paths are now normalized with POSIX path utilities.
  • Existing user-authored Qoder hooks are preserved while Orca manages only qoder-hook.* entries.

Notes

Scope rationale

This PR intentionally delivers Qoder support as one coherent vertical slice. Registering the agent without hook-state synchronization and session resume would advertise only partial support and create inconsistent local/SSH behavior. Issue #7480 describes the original Qoder-vs-Gemini identity symptom; the PR title and summary explicitly cover the broader first-class-agent integration. No unrelated refactor is included.

The change does not require a config migration and does not enable merge or auto-merge behavior.

Fixes #7480

ELI5

Orca now supports Qoder CLI as a first-class agent, just like other coding tools you can launch. You can start it, get status hooks, and resume sessions so it fits the normal agent workflow.

dalveytech-vincent and others added 4 commits July 8, 2026 13:41
Register qodercli as a first-class TuiAgent so tab badges, settings, and
mobile pickers show the Qoder icon instead of misidentifying it as Gemini.
Process recognition maps the qodercli foreground binary, and title parsing
prefers Qoder before Gemini-style OSC glyphs.

Fixes stablyai#7480
Locks in the stablyai#7480 fix path where qodercli foreground identity must win
over ◇/✦ titles that otherwise classify as Gemini.
Document Qoder-before-Gemini precedence in getAgentLabel and add
title-only tab-agent tests for qodercli markers vs bare Gemini glyphs.
- Change promptInjectionMode from 'flag-prompt-interactive' to
  'stdin-after-start': qodercli does not have a --prompt-interactive
  flag; its -p flag runs in headless mode that exits on completion.
  stdin-after-start launches the bare TUI and injects the prompt
  after startup, matching aider, devin, goose, etc.

- Rename display label from 'Qoder' to 'Qoder CLI' across all
  surfaces (display names, agent catalog, agent status, mobile,
  i18n locales) for consistency with the terminal title label.

- Add startup plan test verifying stdin-after-start contract for
  qodercli (launchCommand='qodercli', followupPrompt carries prompt).

- Split Qoder title disambiguation tests into a dedicated file
  (qoder-title-disambiguation.test.ts) to keep use-tab-agent.test.ts
  under the max-lines budget. Tests cover: process identity priority,
  idle-glyph (◇) disambiguation, working-glyph (✦) disambiguation,
  and bare Gemini glyph fallback.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c0a01264-3118-429c-97da-9c545a74bf05

📥 Commits

Reviewing files that changed from the base of the PR and between ca38f11f12291c0c5847acbe8b7231d7bb6b279c and e615778.

📒 Files selected for processing (1)
  • mobile/src/tasks/mobile-tui-agents.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • mobile/src/tasks/mobile-tui-agents.ts

📝 Walkthrough

Walkthrough

Added Qoder CLI as a supported TUI agent across shared types, runtime configuration, permissions, telemetry, selection, terminal and process detection, renderer metadata, localization, and mobile settings. Added Qoder-specific startup and title-disambiguation tests, plus process-recognition and explicit-title coverage.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and testing, but it omits required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the missing template sections: Screenshots, a filled Testing checklist, AI Review Report, Security Audit, and Notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: correcting Qoder CLI display-name behavior and prompt launch handling.
Linked Issues check ✅ Passed The changes add Qoder identity, icon/title labeling, and recognition paths needed for #7480.
Out of Scope Changes check ✅ Passed All changes appear tied to Qoder identity, title detection, launch behavior, labels, localization, and tests; no unrelated edits stand out.

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.

… disambiguation to upstream's agent-title-core module
@Eridanus117
Eridanus117 force-pushed the feat/qoder-cli-agent-support branch from ca38f11 to e615778 Compare July 13, 2026 21:51
@Eridanus117 Eridanus117 changed the title fix(agents): correct qodercli promptInjectionMode and display name feat(agents): add Qoder CLI as a supported agent Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added Qoder CLI as a supported TUI agent across shared types, runtime configuration, permissions, telemetry, selection, terminal and process detection, renderer metadata, localization, hook handling, session resume, and mobile settings. Added Qoder-specific startup and title-disambiguation tests, plus process-recognition and explicit-title coverage.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes substantial hook, resume, telemetry, mobile, and localization work beyond #7480’s icon/title request. Split the broader Qoder support work into separate PRs, or add linked issues covering hook, resume, mobile, and localization scope.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR resolves #7480 by making Qoder use its own icon/title instead of Gemini and adding Qoder-specific detection and labels.
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding Qoder CLI support as a new agent.
Description check ✅ Passed The description covers all required sections and includes summary, screenshots, testing, security, AI review, and notes with substantive detail.

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.

@nwparker

Copy link
Copy Markdown
Contributor

thanks, we'll get these in but after we launch a plugin system. Coming soon

Add full hook service for qodercli, enabling real-time status tracking
(working/waiting/done), session ID capture, and session resume.

Hook service (src/main/qoder/hook-service.ts):
- Installs managed command-type hooks into ~/.qoder/settings.json
- Hooks for: SessionStart, UserPromptSubmit, Stop, StopFailure,
  SessionEnd, PreToolUse, PostToolUse, PostToolUseFailure, Notification
- Managed script POSTs to /hook/qoder via curl (same pattern as
  Claude/Grok — sources endpoint file for live port/token)

Hook listener (src/shared/agent-hook-listener.ts):
- Add /hook/qoder pathname routing
- Add normalizeQoderEvent: maps events to working/waiting/done states,
  handles Notification with notification_type (permission_prompt→waiting,
  idle_prompt→done), SessionStart clears turn cache
- Reuses extractClaudeToolFields (qodercli has Claude-compatible payload)
- UserPromptSubmit is the new-turn boundary

Session resume (src/shared/agent-session-resume.ts):
- Add 'qoder' to RESUMABLE_TUI_AGENTS
- extractAgentProviderSession: extracts session_id + transcript_path
- getAgentResumeArgv: ['qodercli', '-r', id]

Registration:
- Add 'qoder' to AGENT_HOOK_TARGETS (cascades to telemetry schema)
- Add 'qoder' to AgentHookSource union
- Register qoderHookService in managed-agent-hook-controls.ts

@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: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: be7dfb72-8eb7-44c0-9f72-81ec9469ab9d

📥 Commits

Reviewing files that changed from the base of the PR and between e615778 and d771246.

📒 Files selected for processing (6)
  • src/main/agent-hooks/managed-agent-hook-controls.ts
  • src/main/qoder/hook-service.ts
  • src/shared/agent-hook-listener.ts
  • src/shared/agent-hook-relay.ts
  • src/shared/agent-hook-types.ts
  • src/shared/agent-session-resume.ts

Comment thread src/main/qoder/hook-service.ts Resolved
Comment thread src/shared/agent-hook-listener.ts Resolved
@quguai

quguai commented Jul 16, 2026

Copy link
Copy Markdown

expectations

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/qoder/hook-service.ts (1)

241-243: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Use path utilities instead of assuming slash separators.

The construction of remoteConfigPath and remoteScriptPath uses string interpolation with explicit / characters. As per coding guidelines, use Node path utilities and never assume / or \ for file paths. Since these are remote SFTP paths, they are POSIX-compliant; posix.join from node:path should be used here, which also safely handles normalizing any trailing slashes in remoteHome.

🛠️ Proposed fix to use `posix.join`

Ensure you import posix at the top of the file:

import { posix } from 'node:path'

Then update the path construction:

-    const home = remoteHome.replace(/\/$/, '')
-    const remoteConfigPath = `${home}/.qoder/settings.json`
-    const remoteScriptPath = `${home}/.orca/agent-hooks/qoder-hook.sh`
+    const remoteConfigPath = posix.join(remoteHome, '.qoder', 'settings.json')
+    const remoteScriptPath = posix.join(remoteHome, '.orca', 'agent-hooks', 'qoder-hook.sh')

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a2e1d6c8-e51c-4567-8ed3-6a4d81e174d3

📥 Commits

Reviewing files that changed from the base of the PR and between d771246 and 414a92f.

📒 Files selected for processing (3)
  • config/tsconfig.cli.json
  • src/main/qoder/hook-service.test.ts
  • src/main/qoder/hook-service.ts

@Eridanus117

Copy link
Copy Markdown
Contributor Author

Closed the remaining CodeRabbit feedback:

  • bf8953d13 replaces manually concatenated SSH paths with posix.join and adds a trailing-slash regression test.
  • The PR description now includes Screenshots, AI Review Report, Security Audit, and Notes.
  • The scope warning is answered with an explicit vertical-slice rationale.
  • The generic docstring warning is explicitly dispositioned against this TypeScript repository's actual lint, typecheck, reliability, max-lines, localization, and test gates.
  • The earlier two inline findings remain resolved and were already acknowledged by CodeRabbit.

Validation: pnpm run lint, pnpm run typecheck, targeted Vitest (2/2), oxfmt --check, and git diff --check all pass.

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

@Eridanus117 Thanks for the update — I'll take a fresh look at the changes, including the posix.join fix for SSH paths and the trailing-slash regression test.

✅ Action performed

Review finished.

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.

@Eridanus117

Copy link
Copy Markdown
Contributor Author

the icon has some problem ,should be changed

@nwparker nwparker added the enhancement New feature or request label Jul 27, 2026
@houlemon0130

Copy link
Copy Markdown

Thanks for putting in the work for full Qoder CLI support — the hook-service integration looks especially useful. Looking forward to seeing this progress once the icon is sorted!

@chinleo

chinleo commented Aug 13, 2026

Copy link
Copy Markdown

所以这个功能能被合并吗? 我已经观察好久了...

@Eridanus117

Copy link
Copy Markdown
Contributor Author

@chinleo

chinleo commented Aug 20, 2026

Copy link
Copy Markdown

@Eridanus117 分支冲突了, 能否处理下?

@nwparker

Copy link
Copy Markdown
Contributor

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

The consolidated change carries forward the Qoder hook source, permission/notification mapping and resume support. Installed Qoder 1.1.64 now supports --prompt-interactive; startup/resume events preserve session identity and compact restarts are ignored.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: add qoder agent icon show

6 participants