feat(agents): add grok, cursor, qwen, copilot, kimi adapters#145
Conversation
Registers the grok harness (xAI Grok CLI). grok installs Claude Code-compatible hooks, so it reuses the claude-code activity deriver already in the platform. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Registers the cursor harness, stacked on the agent platform. Includes its own activity deriver. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Registers the qwen harness, stacked on the agent platform. Includes its own activity deriver. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(agents): add copilot adapter Registers the copilot harness, stacked on the agent platform. Includes its own activity deriver. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Update backend/internal/adapters/agent/copilot/hooks.go Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix(copilot): map permission-request to documented preToolUse event Copilot CLI does not document a "permissionRequest" hook event. Per https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-hooks the documented camelCase events are sessionStart, sessionEnd, userPromptSubmitted, preToolUse, postToolUse, errorOccurred, agentStop. Writing "permissionRequest" into .github/hooks/ao.json silently disables that hook because Copilot does not recognize the key. Remap AO's permission-request sub-command onto preToolUse (the closest documented signal — fires before any tool invocation, including ones that would prompt for approval) and add a tripwire test asserting the JSON keys AO writes match the documented camelCase names. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore(copilot): gofmt the new tripwire test Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Harshit Singh Bhandari <dev@theharshitsingh.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: harshitsinghbhandari <24b4506@iitb.ac.in>
Registers the kimi harness, stacked on the agent platform. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Kimi rejects `--prompt` combined with `--yolo`/`--auto`/`--plan`, and rejects `--yolo`/`--auto` combined with `--session`/`--continue` (non-interactive and resumed sessions inherit the auto permission policy). The previous mapping appended one of those flags before `-p` on every launch and before `--session` on every restore, so every non-interactive launch would fail at startup. The local binary (v1.37.0) additionally has no `--auto` option at all, which would fail even on otherwise-permissible paths. - GetLaunchCommand: emit approval flags only on the interactive path (no prompt). The `-p <prompt>` path is now bare. - GetRestoreCommand: never emit approval flags; resumed sessions inherit the original session's approval settings. - Tests assert no approval/plan flag leaks onto either path for any PermissionMode, and keep the interactive mapping unchanged. Refs: https://moonshotai.github.io/kimi-code/en/reference/kimi-command.html
Greptile SummaryThis PR adds five agent adapters — Grok Build, Cursor, Qwen Code, GitHub Copilot, and Kimi CLI — wiring them into the registry and activity-dispatch layer alongside the existing claude-code and codex adapters.
Confidence Score: 5/5All five adapters are self-contained and additive; no existing adapter logic is modified. Each new adapter is backed by focused unit tests and the end-to-end wiring test. The changes are purely additive — new adapter packages wired into the registry and activity dispatcher, with no modifications to shared infrastructure. Hook installation uses atomic writes, the qwen sync-before-rename gap previously flagged was already fixed in an earlier commit, and the Kimi no-hook/no-approval-flag invariants are well-tested. The only notable issue is a stale one-liner in the grok package comment that contradicts the actual flag the binary receives. No files require special attention; grok.go has a minor package-level comment inconsistency worth tidying. Important Files Changed
Sequence DiagramsequenceDiagram
participant AO as AO Daemon
participant Reg as registry.Constructors()
participant Adapter as Agent Adapter
participant HooksFile as Hooks Config File
participant Agent as Agent CLI Binary
participant Dispatch as activitydispatch.Derive()
AO->>Reg: Build()
Reg-->>AO: [claudecode, codex, grok, cursor, qwen, copilot, kimi]
AO->>Adapter: GetAgentHooks(WorkspaceHookConfig)
Adapter->>HooksFile: atomicWrite(hooks.json / settings.json / ao.json)
HooksFile-->>Adapter: ok
AO->>Adapter: GetLaunchCommand(LaunchConfig)
Adapter-->>AO: [binary, flags..., -p, prompt]
AO->>Agent: exec(cmd)
Agent->>AO: ao hooks agent event
AO->>Dispatch: Derive(agent, event, payload)
Dispatch-->>AO: ActivityState
AO->>AO: ApplyActivitySignal
Reviews (2): Last reviewed commit: "fix(agents/grok): delegate hook cleanup ..." | Re-trigger Greptile |
|
Also addressed the Greptile comment outside the diff: Grok now delegates AreHooksInstalled and UninstallHooks to the Claude Code adapter, matching its delegated GetAgentHooks path. Added a lifecycle test and ran: cd backend && go test -race ./internal/adapters/agent/grok ./internal/adapters/agent/claudecode |
…r, goose, auggie, continue, devin, cline, kiro, kilocode, vibe, pi, autohand) (#150) * feat(agents): add droid adapter Registers the droid harness, stacked on the agent platform. Includes its own activity deriver. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(agents): add amp adapter Registers the amp harness, stacked on the agent platform. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(agents): add agy adapter Registers the agy harness, stacked on the agent platform. Includes its own activity deriver. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(agents): add crush, aider, goose, auggie, continue, devin, cline, kiro, kilocode, vibe, pi, autohand adapters Cherry-pick batch landing the remaining 12 yyovil adapter directories per Discussion #148 recipe, on top of #145 (grok/cursor/qwen/copilot/kimi) and the droid/amp/agy commits earlier on this branch. Each adapter is a self-contained package under backend/internal/adapters/agent/<name>/; registry.Constructors(), activitydispatch.Derivers (for adapters with activity.go), and wiring_test.go are unified to register all 23 shipped adapters in one place. No new migration: 0007_allow_implemented_harnesses already widens the sessions.harness CHECK to cover every adapter. * fix(agents/kilocode): return error from json.Marshal of permission config Previously the marshal error was discarded and the function returned a prefix carrying an empty KILO_CONFIG_CONTENT. An unrecoverable marshal failure for the typed map should never happen in practice, but if it ever did, Kilo would silently launch with default permissions regardless of the requested mode. Surface it as "no prefix" so the caller's mode choice can't be misrepresented. --------- Co-authored-by: yyovil <itsyyovil@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Stacks five agent adapters on top of the agent platform (#119). Each adapter lives in backend/internal/adapters/agent// and is wired via registry.Constructors() and daemon/wiring_test.go.
Notes:
Originally part of yyovil's agents/* stacked branches; cherry-picked clean onto main.