Repository navigation
feat(agents): add Qoder CLI as a supported agent - #8611
Eridanus117 wants to merge 8 commits into
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between ca38f11f12291c0c5847acbe8b7231d7bb6b279c and e615778. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded 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)
✅ Passed checks (3 passed)
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 |
… disambiguation to upstream's agent-title-core module
ca38f11 to
e615778
Compare
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdded 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)
✅ Passed checks (3 passed)
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 |
|
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
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: be7dfb72-8eb7-44c0-9f72-81ec9469ab9d
📒 Files selected for processing (6)
src/main/agent-hooks/managed-agent-hook-controls.tssrc/main/qoder/hook-service.tssrc/shared/agent-hook-listener.tssrc/shared/agent-hook-relay.tssrc/shared/agent-hook-types.tssrc/shared/agent-session-resume.ts
|
expectations |
There was a problem hiding this comment.
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 winUse path utilities instead of assuming slash separators.
The construction of
remoteConfigPathandremoteScriptPathuses 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.joinfromnode:pathshould be used here, which also safely handles normalizing any trailing slashes inremoteHome.🛠️ Proposed fix to use `posix.join`
Ensure you import
posixat 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
📒 Files selected for processing (3)
config/tsconfig.cli.jsonsrc/main/qoder/hook-service.test.tssrc/main/qoder/hook-service.ts
|
Closed the remaining CodeRabbit feedback:
Validation: @coderabbitai review |
|
✅ Action performedReview finished.
|
|
the icon has some problem ,should be changed |
|
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! |
|
所以这个功能能被合并吗? 我已经观察好久了... |
|
@Eridanus117 分支冲突了, 能否处理下? |
|
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 Your contribution is credited with a |
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]>
|
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. |
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):
TuiAgentunion, launch config, display names, telemetry, permissions, auto-pick orderpromptInjectionMode: 'stdin-after-start'— qodercli's-pflag 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-interactiveflag.'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.isQoderTerminalTitlechecks for aqoderclitoken marker and short-circuits before Gemini glyph heuristics.Hook integration (new):
src/main/qoder/hook-service.ts) — installs managedcommand-type hooks into~/.qoder/settings.json, same pattern as Claude/Grok/all other agentsSessionStart,UserPromptSubmit,Stop,StopFailure,SessionEnd,PreToolUse,PermissionRequest,PostToolUse,PostToolUseFailure,NotificationnormalizeQoderEventinagent-hook-listener.ts— maps events to working/waiting/done states, handlesNotificationwithnotification_type(permission_prompt→waiting, idle_prompt→done),SessionStartclears turn cacheextractClaudeToolFields— qodercli has Claude-compatibletool_name/tool_inputpayload fieldsmanaged-agent-hook-controls.ts(install/remove/status)'qoder'added toAGENT_HOOK_TARGETS(cascades to telemetry schema) andAgentHookSourceunionSession resume (new):
'qoder'added toRESUMABLE_TUI_AGENTSextractAgentProviderSession: extractssession_id+transcript_pathfrom hook payloadsgetAgentResumeArgv:['qodercli', '-r', id]— qodercli's documented resume flagKey decisions
commandtype hooks (nothttp): all 14 existing agents in Orca usecommandtype. Thecommandtype 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 nativetype: "http"hooks, but we chosecommandfor consistency and the endpoint-file mechanism.stdin-after-startprompt injection: qodercli's-pflag runs in headless mode that exits on completion. The bare TUI is launched and the prompt injected after startup, matchingaider,devin,goose, etc.UserPromptSubmit,Stop,PreToolUse, etc.) and payload fields as Claude Code, sonormalizeQoderEventis modeled onnormalizeKimiEventwithNotificationhandling added.--yolopermission mode: matches qodercli's documented skip-permissions flag.preflightTrustneeded.Files changed
Shared layer (18 files)
types.ts'qoder'inTuiAgentuniontui-agent-config.tsstdin-after-starttui-agent-display-names.ts'Qoder CLI'agent-kind.tstelemetry-events.ts'qoder'inAGENT_KIND_VALUEStui-agent-permissions.ts--yoloYOLO modetui-agent-selection.tsagent-status-types.tsWellKnownAgentTypeagent-name-token-match.tsqoderclitoken matching +isQoderTerminalTitleagent-title-core.tsisGeminiTerminalTitlegemini-terminal-title.tsterminal-title-agent-type.tsgetAgentLabel+TITLE_LABEL_TO_AGENTagent-hook-types.ts'qoder'inAGENT_HOOK_TARGETSagent-hook-relay.ts'qoder'inAgentHookSourceagent-hook-listener.tsnormalizeQoderEvent+extractToolFields+isNewTurnEventagent-session-resume.tsRESUMABLE_TUI_AGENTS+extractAgentProviderSession+getAgentResumeArgvagent-detection.tsMain process (2 files)
src/main/qoder/hook-service.ts~/.qoder/settings.jsonmanaged-agent-hook-controls.tsqoderHookService(install/remove/status)Renderer (4 files)
agent-catalog.tsxqoder.comfaviconagent-status.tsqoder-title-disambiguation.test.tsuse-tab-agent.test.tsMobile & i18n (6 files)
mobile-tui-agents.ts"Qoder CLI"localized labelScreenshots
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 filespnpm run typecheck— passespnpm exec vitest run --config config/vitest.config.ts src/main/qoder/hook-service.test.ts— 2/2 tests pass for localPermissionRequestinstallation and remote POSIX path normalizationpnpm verify:localization-catalogand localization coverage checks passoxfmt --checkandgit diff --checkpassmainAI Review Report
CodeRabbit actionable findings are 3/3 addressed:
PermissionRequestinQODER_EVENTSand verify it is written to.qoder/settings.json(414a92fff).normalizeQoderEventpermission-waiting branch reachable through the installed event (414a92fff).posix.joinand 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
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.