feat: add complete Qoder IDE platform integration#831
Conversation
|
@ken-jo @mksglu Thanks for the review. I've combined both PRs into a single PR that covers the complete Qoder integration:
Regarding live Qoder CLI validation: I was unable to perform a model-backed Note: |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds first-class Qoder platform support (detection, adapter, hooks, and templates) so context-mode can run as a JSON-stdio hook integration inside the Qoder IDE.
Changes:
- Introduces
QoderAdapterwith parsing/formatting, hook config generation, and diagnostics. - Adds Qoder hook scripts + config templates (
configs/qoder/*) and extends CLI hook dispatch mapping. - Extends platform detection, client mapping, docs, and test suites to include
qoder.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/adapters/qoder/index.ts |
New Qoder adapter implementation (parsing, responses, config/diagnostics). |
src/adapters/qoder/hooks.ts |
Qoder hook constants + hook command helpers/validators. |
hooks/qoder/*.mjs |
Hook entrypoints for Qoder (pretooluse, posttooluse, userpromptsubmit, stop). |
hooks/core/formatters.mjs |
Adds Qoder response formatter for formatDecision(). |
src/adapters/detect.ts |
Adds Qoder detection (env var, config dir) + adapter factory branch. |
src/cli.ts |
Adds Qoder hook dispatch map entries. |
src/adapters/types.ts |
Adds "qoder" to PlatformId. |
src/adapters/client-map.ts |
Maps MCP clientInfo.name values to qoder. |
hooks/session-helpers.mjs |
Adds QODER_OPTS for session/project dir env resolution. |
configs/qoder/* |
Adds Qoder settings + MCP templates and instructions (QODER.md). |
docs/platform-support.md |
Documents Qoder support and updates comparison/capability matrices. |
tests/adapters/qoder.test.ts |
Adds adapter-focused unit tests and config template consistency checks. |
tests/adapters/detect*.test.ts |
Updates detection tests to account for QODER_AGENT and qoder platform. |
tests/fixtures/qoder/*.json |
Adds Qoder hook payload fixtures used by tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add first-class support for Qoder IDE (VS Code-based agentic IDE by Alibaba Group) with json-stdio hook paradigm and hookSpecificOutput wire format compatible with Claude Code. Adapter core (src/adapters/qoder/): - QoderAdapter class with full HookAdapter implementation - Parse/format PreToolUse, PostToolUse, Stop, UserPromptSubmit events - Tool name mapping (run_in_terminal→Bash, create_file→Write, etc.) - Hook config management via .qoder/settings.json - Session ID extraction: session_id → QODER_SESSION_ID → pid fallback Platform detection (src/adapters/detect.ts): - QODER_AGENT env var checked before VSCODE_PID (Qoder is a VS Code fork) - ~/.qoder/ config dir as medium-confidence fallback - Lazy-load adapter via dynamic import Hook scripts (hooks/qoder/): - pretooluse.mjs: stdin → routePreToolUse → formatDecision → stdout - posttooluse.mjs: passthrough (session capture, no routing) - stop.mjs: passthrough (exit 0) - userpromptsubmit.mjs: passthrough with future route-injection point Formatter (hooks/core/formatters.mjs): - 'qoder' formatter with hookSpecificOutput wire format - Bash redirect→deny conversion (same as claude-code/cursor) - typeof guard on updatedInput before 'in' operator Config templates (configs/qoder/): - QODER.md: routing instructions for Qoder users - mcp.json: MCP server registration template - settings.json: hook configuration reference (4 events) Documentation (docs/platform-support.md): - Platform count: 16 → 17 - Qoder column in all comparison tables - Detailed Qoder platform section with capability labeling CLI dispatch (src/cli.ts): - Hook dispatcher entry for qoder (pretooluse, posttooluse, etc.) Tests: - 37 unit tests (tests/adapters/qoder.test.ts) - Config template validation tests (mcp.json, settings.json schema) - Test isolation: clear QODER_AGENT in detect tests - Address Copilot review: type-safe cmd coercion, event-aware isContextModeHook, passthrough comment clarity fix: address Copilot review feedback on Qoder integration
bcb3bba to
3291b0d
Compare
Summary
Add first-class Qoder IDE platform support as a single, complete integration PR. Qoder is a VS Code-based agentic IDE developed by Alibaba Group. This replaces the previously split PRs #798 and #799.
What
Adapter core (
src/adapters/qoder/)QoderAdapterclass implementingHookAdapterwith json-stdio paradigmrun_in_terminal→Bash,read_file→Read,create_file→Write,search_replace→Edit.qoder/settings.json(read/write/configure/validate)session_id→QODER_SESSION_IDenv →pid-${ppid}fallbackPlatform detection (
src/adapters/detect.ts)QODER_AGENTenv var checked beforeVSCODE_PID(Qoder inherits it as a VS Code fork)~/.qoder/config directory as medium-confidence fallbackimport()Hook scripts (
hooks/qoder/)pretooluse.mjs— Full routing: stdin →routePreToolUse→formatDecision→ stdoutposttooluse.mjs— Passthrough (session event capture, no routing decision)stop.mjs— Passthrough (exit 0)userpromptsubmit.mjs— Passthrough with future route-injection hook pointFormatter (
hooks/core/formatters.mjs)qoderformatter entry withhookSpecificOutputwire format (compatible with Claude Code)typeofguard onupdatedInputbeforeinoperator to prevent TypeErrorConfig templates (
configs/qoder/)QODER.md— Routing instructions (Bash curl/wget →ctx_fetch_and_index, etc.)mcp.json— MCP server registration templatesettings.json— Hook configuration reference (all 4 event types)Documentation (
docs/platform-support.md)CLI dispatch (
src/cli.ts)qoder(pretooluse, posttooluse, userpromptsubmit, stop)Other modifications
src/adapters/types.ts— AddqodertoPlatformIdunionsrc/adapters/client-map.ts— Add MCP client name mapping (qoder/Qoder)hooks/session-helpers.mjs— AddQODER_OPTS(configDir, projectDirEnv, sessionIdEnv)Design Decisions
QODER_AGENTbeforeVSCODE_PIDbecause Qoder is a VS Code fork and always setsVSCODE_PID.hookSpecificOutputJSON structure as Claude Code. The formatter includes the same Bash redirect-to-deny logic.Testing
tests/adapters/qoder.test.ts:Notes
qodercli plugin validatecan be run againstconfigs/qoder/to verify plugin structure once Qoder login is available