Skip to content

feat(agents): add continue adapter#131

Closed
yyovil wants to merge 1 commit into
agents/11-auggiefrom
agents/12-continue
Closed

feat(agents): add continue adapter#131
yyovil wants to merge 1 commit into
agents/11-auggiefrom
agents/12-continue

Conversation

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 6, 2026

Greptile Summary

Adds the continueagent adapter for the Continue CLI (cn binary), wiring it into the agent registry and adding a resolver test. Continue reuses Claude Code's hook infrastructure (it natively reads .claude/settings.local.json) so the adapter delegates GetAgentHooks directly to claudecode.Plugin, and session metadata is read from the same ports.MetadataKey* constants.

  • New continueagent package: implements all ports.Agent methods — launch, restore via --fork, hook delegation, and session info — with a binary resolver that searches PATH and common npm install locations.
  • Registry and wiring: continueagent.New() added to Constructors(), and domain.HarnessContinue / \"continue\" added to the resolver smoke test.

Confidence Score: 5/5

Safe to merge — the adapter correctly implements all required interface methods, the prompt is properly guarded with --, and hook delegation to the claudecode installer is both sound and well-documented.

The change is a self-contained new adapter with no modifications to existing behaviour. The binary resolution, permission flag mapping, restore-via---fork, and hook delegation all look correct. No existing code paths are touched beyond a single-line registry addition and a one-line wiring test entry.

No files require special attention.

Important Files Changed

Filename Overview
backend/internal/adapters/agent/continueagent/continueagent.go Core adapter implementation; all interface methods are correctly implemented, prompt is guarded with --, and hook delegation to claudecode is well-documented. Minor doc comment imprecision and a capacity off-by-one in GetRestoreCommand.
backend/internal/adapters/agent/continueagent/continueagent_test.go Good coverage of launch/restore/permissions/session-info paths and context-cancellation edge cases; tests use a pre-seeded resolvedBinary to avoid filesystem hits.
backend/internal/adapters/agent/registry/registry.go Single-line addition of continueagent.New() to Constructors(); no issues.
backend/internal/daemon/wiring_test.go Single-line addition of HarnessContinue to the resolver smoke test; correctly mirrors the registry registration.

Sequence Diagram

sequenceDiagram
    participant AO as AO Daemon
    participant CA as continueagent.Plugin
    participant CC as claudecode.Plugin
    participant FS as Filesystem
    participant CN as cn binary

    AO->>CA: GetAgentHooks(ctx, cfg)
    CA->>CC: "(&claudecode.Plugin{}).GetAgentHooks(ctx, cfg)"
    CC->>FS: write .claude/settings.local.json
    FS-->>CC: ok
    CC-->>CA: nil
    CA-->>AO: nil

    AO->>CA: GetLaunchCommand(ctx, cfg)
    CA->>CA: continueBinary(ctx) → resolves/caches cn path
    CA-->>AO: [cn, --print, (--auto), --, prompt]

    AO->>CN: exec(launch command)
    CN->>FS: reads .claude/settings.local.json hooks
    CN-->>AO: hook events (SessionStart / Stop / etc.)

    AO->>CA: GetRestoreCommand(ctx, cfg)
    CA-->>AO: [cn, --print, (--auto), --fork, agentSessionID]

    AO->>CA: SessionInfo(ctx, session)
    CA-->>AO: "{AgentSessionID, Title, Summary} from ports.MetadataKey* constants"
Loading

Reviews (2): Last reviewed commit: "feat(agents): add continue adapter" | Re-trigger Greptile

Comment thread backend/internal/adapters/agent/continueagent/continueagent.go
Comment thread backend/internal/adapters/agent/continueagent/continueagent.go Outdated
Registers the continue harness, stacked on the agent platform.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants