Skip to content

chore(deps): migrate ACP SDK from agentcooper fork to upstream v0.13.0#921

Open
carlosflorencio wants to merge 5 commits into
mainfrom
worktree-acp-sdk-upstream-migrate
Open

chore(deps): migrate ACP SDK from agentcooper fork to upstream v0.13.0#921
carlosflorencio wants to merge 5 commits into
mainfrom
worktree-acp-sdk-upstream-migrate

Conversation

@carlosflorencio
Copy link
Copy Markdown
Member

@carlosflorencio carlosflorencio commented May 16, 2026

The fork was vendored via go.mod replace to pick up a notification ordering fix (coder/acp-go-sdk#20), but the fix landed upstream in PR #8 (2026-02-24) — three days before the fork commit we pinned. Upstream v0.13.0 is a strict superset of the fork on the session API (gains CloseSession; promotes ListSessions/ResumeSession out of Unstable) and also includes the WaitGroup-reuse fix in #30.

Important Changes

  • Drop replace github.com/coder/acp-go-sdk => github.com/agentcooper/acp-go-sdk ...; bump require to v0.13.0.
  • Rename acp.UnstableModelId/UnstableModelInfo/UnstableSessionModelState to their un-prefixed names. UnstableSetSessionModelRequest.ModelId still uses UnstableModelId upstream — kept as-is.
  • acp.SetSessionConfigOptionRequest is now a tagged union; wrap our existing call in the ValueId variant.
  • acp.AuthMethod is now a tagged union of {Agent, Terminal, EnvVar}; added flattenAuthMethod / authMethodFields helpers to collapse it back to the flat (id, name, description, meta) shape our streams and probe layers expect.
  • Rename KillTerminalCommand*KillTerminal* in internal/agentctl/server/acp/client.go.
  • Add CloseSession / ListSessions / ResumeSession stubs to cmd/mock-agent to satisfy the wider upstream acp.Agent interface.
  • Refresh stale comments referencing the fork.

Validation

  • go test ./... from apps/backend — 5979 tests passing across 196 packages.
  • make lint — 0 issues.
  • TestNotificationOrderingFix — 3 consecutive -count=3 runs pass, confirming upstream's serialized notification path preserves ordering.

Possible Improvements

Low risk. Behavior on the wire is unchanged; SDK type-shape changes are mechanical and covered by existing tests. The new AuthMethod union has typed Terminal/EnvVar variants we could use instead of the _meta.terminal-auth reflection path, but that is a follow-up.

Checklist

  • I have performed a self-review of my code.
  • I have manually tested my changes and they work as expected.
  • My changes have tests that cover the new functionality and edge cases.
  • If my change touches UI files (apps/web/), I have added or updated Playwright e2e tests in apps/web/e2e/ and verified them with make test-e2e.

Preview Environment

URL https://kandev-pr-921-bwo7.sprites.app
Commit 5de8495
Agent Mock agent

Updates automatically on each push. Destroyed when the PR is closed.

Upstream coder/acp-go-sdk#8 (merged 2026-02-24) fixed the notification
ordering race that originally justified the fork. v0.13.0 is a strict
superset of the fork on the session API surface and adds CloseSession,
plus the WaitGroup-reuse fix in #30.

- Drop replace directive; bump require to v0.13.0
- Rename UnstableModelId/Info/SessionModelState -> ModelId/Info/SessionModelState
  (UnstableSetSessionModelRequest still uses UnstableModelId upstream)
- Rename KillTerminalCommand -> KillTerminal
- Wrap SetSessionConfigOptionRequest in new ValueId tagged-union variant
- Collapse new AuthMethod tagged union ({Agent,Terminal,EnvVar}) back to
  flat (id, name, description, meta) via helpers in convertAuthMethods
  and probe payload builder
- Add CloseSession / ListSessions / ResumeSession stubs to mock-agent to
  satisfy the wider upstream Agent interface
- Refresh stale comments referencing the fork
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR upgrades the ACP SDK from v0.6.3 to v0.13.0, stabilizing model and session types throughout the adapter and mock layers, adding auth-method extraction helpers, implementing session lifecycle handlers in the mock agent, and updating ACP protocol method signatures.

Changes

ACP SDK Upgrade and Stabilization

Layer / File(s) Summary
Dependency upgrade to acp-go-sdk v0.13.0
apps/backend/go.mod
Bump github.com/coder/acp-go-sdk from v0.6.3 to v0.13.0; promote docker-go-connections and lumberjack.v2 to direct (non-indirect) dependencies.
Stabilize model and session types to stable SDK variants
apps/backend/cmd/mock-agent/main.go, apps/backend/internal/agentctl/server/adapter/transport/acp/adapter.go, apps/backend/internal/agentctl/server/adapter/transport/acp/meta_convert.go
Replace UnstableSessionModelState with SessionModelState and UnstableModelInfo with ModelInfo in mock agent's mockSessionModels, adapter's availableModels cache, emitSessionModels signature, and convertSessionModels parameter type.
Extract auth method fields via shared helper
apps/backend/internal/agentctl/server/acp/authmethod.go, apps/backend/internal/agentctl/server/adapter/transport/acp/meta_convert.go, apps/backend/internal/agentctl/server/utility/acp_executor.go
Introduce AuthMethodFields helper to normalize auth method variant matching; update convertAuthMethods and buildInitProbeFields to call this helper instead of accessing struct fields directly.
Implement session lifecycle handlers in mock agent
apps/backend/cmd/mock-agent/main.go
Add CloseSession (clears per-session state under mutex), ListSessions (returns empty), and ResumeSession (returns unsupported) to mock agent.
Update ACP protocol method signatures and request shapes
apps/backend/internal/agentctl/server/acp/client.go, apps/backend/internal/agentctl/server/adapter/transport/acp/adapter.go
Rename KillTerminalCommand to KillTerminal with updated request/response types; wrap SetConfigOption fields in nested SetSessionConfigOptionValueId struct.
Update documentation and remove obsolete comments
apps/backend/internal/agent/acpdbg/ops.go, apps/backend/internal/agentctl/server/adapter/transport/acp/ordering_race_test.go, apps/backend/internal/agentctl/server/utility/acp_executor.go
Remove unstable-variant fallback comment in sendSetModel; update test comment with upstream acp-go-sdk attribution; clarify MCP server helper documentation.

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly Related PRs

  • kdlbs/kandev#404: Updates ACP model ID resolution and available-models validation; complements the stable model types introduced in this PR.
  • kdlbs/kandev#602: Relies on stable session model data from the mock agent and adapter to prevent null models in Utility Agents UI.

Poem

🐰 From unstable to steady, we hop along clear,
SDK models now stable, no fallbacks to fear!
Auth fields extracted, lifecycles tended with care,
The ACP garden grows greener with each careful pair. 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: migrating from a fork to the upstream ACP SDK v0.13.0, which is the primary objective of the PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed PR description comprehensively covers objectives, changes, validation, and improvements with proper structure and detail.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-acp-sdk-upstream-migrate

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 and usage tips.

@claude
Copy link
Copy Markdown

claude Bot commented May 16, 2026

Claude finished @carlosflorencio's task in 1m 37s —— View job


Code Review

  • Gather context
  • Review changed files
  • Post findings

Verdict: Ready to merge. Clean mechanical SDK migration with no blockers. One suggestion posted as an inline comment: flattenAuthMethod (meta_convert.go:38) and authMethodFields (acp_executor.go:474) are identical helpers introduced in this PR — worth consolidating into the shared acpclient package before the pattern gets copied further. All renamed types, the tagged-union adaptations, and mock-agent interface stubs look correct. The TestNotificationOrderingFix regression guard confirms upstream's serialized notification path.

Comment thread apps/backend/internal/agentctl/server/adapter/transport/acp/meta_convert.go Outdated
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 16, 2026

Greptile Summary

This PR migrates the ACP Go SDK from a vendored fork (agentcooper/acp-go-sdk) back to the upstream coder/acp-go-sdk v0.13.0, which now includes the notification-ordering fix that originally motivated the fork. The migration involves mechanical type renames (Unstable* prefixes dropped) and adapting to two breaking shape changes: AuthMethod becoming a tagged union (handled via the new shared AuthMethodFields helper) and SetSessionConfigOptionRequest becoming a tagged union.

  • Type renames: UnstableModelInfo, UnstableSessionModelState are promoted to their stable names; KillTerminalCommand* becomes KillTerminal*.
  • Tagged union adapters: AuthMethodFields in authmethod.go is the single consolidation point for flattening the new AuthMethod union; both meta_convert.go and acp_executor.go now delegate to it.
  • Mock-agent completeness: CloseSession, ListSessions, and ResumeSession stubs are added to satisfy the widened acp.Agent interface, and emitAvailableCommandsOnce gains a correct early-exit guard for sessions closed during the post-handshake delay.

Confidence Score: 5/5

Safe to merge — all changes are mechanical SDK type renames and tagged-union adaptations backed by 5979 passing tests and a dedicated ordering regression guard.

Every functional change maps to a named upstream SDK breaking change: the AuthMethod union is handled by a single, well-tested shared helper; SetSessionConfigOptionRequest is correctly wrapped in its ValueId arm; mock-agent stubs satisfy the new interface without side-effects; and the emitAvailableCommandsOnce closed-session guard is correctly sequenced. No logic was altered on any live code path.

No files require special attention.

Important Files Changed

Filename Overview
apps/backend/internal/agentctl/server/acp/authmethod.go New shared helper that collapses the upstream AuthMethod tagged union into a flat (id, name, desc, meta) tuple; eliminates the duplicate-site drift risk flagged in a previous review thread.
apps/backend/internal/agentctl/server/acp/authmethod_test.go Covers all four AuthMethod variants (Agent, Terminal, EnvVar, zero-value) including description nil-handling; complete and correct.
apps/backend/internal/agentctl/server/adapter/transport/acp/adapter.go Two targeted changes: UnstableModelInfo→ModelInfo/UnstableSessionModelState→SessionModelState rename, and SetSessionConfigOptionRequest wrapped in ValueId tagged-union variant.
apps/backend/internal/agentctl/server/adapter/transport/acp/meta_convert.go convertAuthMethods now delegates to the shared AuthMethodFields helper; convertSessionModels gets the ModelInfo rename. Zero-value filtering logic is consistent with acp_executor.go.
apps/backend/cmd/mock-agent/main.go Adds CloseSession/ListSessions/ResumeSession stubs to satisfy widened interface; CloseSession correctly tears down session state; emitAvailableCommandsOnce gains a well-ordered guard for closed sessions.
apps/backend/internal/agentctl/server/utility/acp_executor.go buildInitProbeFields updated to use shared AuthMethodFields helper with the same zero-value filter; stale fork-specific comment removed from toACPMcpServers.
apps/backend/go.mod Fork replace directive removed; acp-go-sdk bumped to v0.13.0; docker/go-connections and lumberjack.v2 promoted from indirect to direct (expected go mod tidy side-effect of the SDK bump).
apps/backend/internal/agentctl/server/acp/client.go Mechanical rename of KillTerminalCommand→KillTerminal with matching request/response type updates; no logic changes.
apps/backend/internal/agentctl/server/adapter/transport/acp/ordering_race_test.go Comment updated to reference upstream fix (coder/acp-go-sdk#8) instead of the fork; test logic unchanged and continues to guard the notification ordering regression.
apps/backend/internal/agent/acpdbg/ops.go Stale comment about fork-specific unstable/stable fallback strategy removed; underlying code unchanged.
AGENTS.md New 'Worktrees and commit hooks' section documents pnpm install prerequisite for fresh worktrees; accurate and useful developer guidance.

Sequence Diagram

sequenceDiagram
    participant Host as Kandev Backend
    participant Adapter as ACP Adapter
    participant Helper as AuthMethodFields(authmethod.go)
    participant SDK as coder/acp-go-sdk v0.13.0
    participant Agent as ACP Agent

    Host->>SDK: Initialize
    SDK->>Agent: initialize request
    Agent-->>SDK: "InitializeResponse{AuthMethods: []AuthMethod}"
    SDK-->>Adapter: InitializeResponse (tagged union)
    Adapter->>Helper: AuthMethodFields(m) for each AuthMethod
    Helper-->>Adapter: (id, name, desc, meta)
    Adapter-->>Host: "ProbeAuthMethod{ID, Name, ...}"

    Host->>SDK: NewSession / LoadSession
    SDK->>Agent: session/new or session/load
    Agent-->>SDK: "SessionModelState (stable, no Unstable* prefix)"
    SDK-->>Adapter: []ModelInfo (was UnstableModelInfo)

    Host->>SDK: SetConfigOption(configID, value)
    SDK->>Agent: "SetSessionConfigOptionRequest{ValueId: &{SessionId, ConfigId, Value}}"
    Agent-->>SDK: SetSessionConfigOptionResponse

    Host->>SDK: CloseSession
    SDK->>Agent: CloseSession (new in v0.13.0)
    Agent-->>SDK: CloseSessionResponse
Loading

Reviews (5): Last reviewed commit: "docs(claude-md): note pnpm install requi..." | Re-trigger Greptile

Comment thread apps/backend/internal/agentctl/server/adapter/transport/acp/meta_convert.go Outdated
@claude
Copy link
Copy Markdown

claude Bot commented May 16, 2026

Findings

Suggestion (recommended, doesn't block)

  1. Duplicated AuthMethod flattenermeta_convert.go:38 and acp_executor.go:474
    • Issue: flattenAuthMethod and authMethodFields are byte-for-byte identical — both introduced in this PR to handle the new tagged-union acp.AuthMethod shape.
    • Why: Will accumulate as a maintenance burden if a fourth AuthMethod variant is added upstream. Both call sites need updating.
    • Fix: Extract to a shared helper in internal/agentctl/server/acp (the client package), which both packages already import. Something like acpclient.FlattenAuthMethod(m acp.AuthMethod) (id, name string, desc *string, meta map[string]any).

Summary

Severity Count
Blocker 0
Suggestion 1

Verdict: Ready to merge

Clean, mechanical migration. The replace directive is correctly dropped, all renamed types (ModelId, ModelInfo, SessionModelState) are updated, the SetSessionConfigOptionRequest tagged-union wrapping is correct, and the AuthMethod union is collapsed properly by the new helpers. Mock-agent stubs satisfy the expanded interface. The TestNotificationOrderingFix regression guard confirms upstream's serialized notification path holds. The duplicated auth-method helper is the only nit — fine to track as a follow-up.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 9 files

Re-trigger cubic

Both meta_convert.go and acp_executor.go had byte-for-byte identical
helpers for collapsing the new tagged-union acp.AuthMethod into a flat
(id, name, description, meta) tuple. A new upstream variant (e.g. OAuth)
would have to be added to both sites or one path silently drops auth
methods of that type.

Move the helper into the existing acpclient package
(internal/agentctl/server/acp) which both call sites already depend on.

Addresses PR #921 review feedback from Claude and Greptile.
@claude
Copy link
Copy Markdown

claude Bot commented May 16, 2026

Claude finished @carlosflorencio's task in 2m 43s —— View job


Code Review

  • Gather context
  • Read review skill guidelines
  • Review changed files
  • Post findings

Findings

Suggestion (recommended, doesn't block)

  1. AuthMethodFields has no unit testinternal/agentctl/server/acp/authmethod.go
    • Issue: The new shared helper dispatches over 4 branches (Agent, Terminal, EnvVar, nil). No authmethod_test.go exists; the only coverage is transitive via integration tests.
    • Why: The function's "silent drop" on an unmatched variant is exactly the failure mode the consolidation was meant to prevent. A simple table-driven TestAuthMethodFields would pin that behavior and catch any future SDK variant addition that goes unhandled.
    • Fix: Add internal/agentctl/server/acp/authmethod_test.go with cases for each variant (Agent/Terminal/EnvVar, plus a zero-value struct that returns empty strings).

Summary

Severity Count
Blocker 0
Suggestion 1

Verdict: Ready to merge

The consolidation commit (7897ea6) correctly resolves the duplication flagged in the previous review. Both convertAuthMethods (meta_convert.go) and buildInitProbeFields (acp_executor.go) now delegate to acpclient.AuthMethodFields — a future SDK variant only needs to be handled in one place. The helper is well-placed in the acp client package (already imported by both callers), correctly commented, and the implementation is clean.

The rest of the migration is unchanged from what was already reviewed: type renames, SetSessionConfigOptionRequestValueId wrapping, KillTerminalCommandKillTerminal, mock-agent stubs, and the TestNotificationOrderingFix regression guard.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/backend/cmd/mock-agent/main.go`:
- Around line 193-199: The CloseSession implementation removes session state but
doesn't prevent already-scheduled emitAvailableCommandsAfterDelay goroutines
from emitting updates for closed sessions; update
emitAvailableCommandsAfterDelay (or the code path that sends
available_commands_update) to acquire a.mu and check that the session id still
exists in a.sessions (or that commandsEmitted entry still exists) before
performing any emit, returning early if the session was removed; reference
mockAgent, CloseSession, emitAvailableCommandsAfterDelay,
available_commands_update, commandsEmitted, sessions and mu when adding this
active-session guard.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a5bcd301-ada2-4eb7-9798-8960e7ee4de7

📥 Commits

Reviewing files that changed from the base of the PR and between 0b20856 and 7897ea6.

⛔ Files ignored due to path filters (1)
  • apps/backend/go.sum is excluded by !**/*.sum
📒 Files selected for processing (9)
  • apps/backend/cmd/mock-agent/main.go
  • apps/backend/go.mod
  • apps/backend/internal/agent/acpdbg/ops.go
  • apps/backend/internal/agentctl/server/acp/authmethod.go
  • apps/backend/internal/agentctl/server/acp/client.go
  • apps/backend/internal/agentctl/server/adapter/transport/acp/adapter.go
  • apps/backend/internal/agentctl/server/adapter/transport/acp/meta_convert.go
  • apps/backend/internal/agentctl/server/adapter/transport/acp/ordering_race_test.go
  • apps/backend/internal/agentctl/server/utility/acp_executor.go
💤 Files with no reviewable changes (1)
  • apps/backend/internal/agent/acpdbg/ops.go

Comment thread apps/backend/cmd/mock-agent/main.go
emitAvailableCommandsAfterDelay sleeps 50ms before emitting the
available_commands_update notification. If CloseSession ran during that
window, the goroutine would still emit for a session the mock has
already forgotten about. Bail out in emitAvailableCommandsOnce when the
session is no longer registered.

Addresses CodeRabbit review on PR #921.
@claude
Copy link
Copy Markdown

claude Bot commented May 16, 2026

Claude finished @carlosflorencio's task in 1m 56s —— View job


Code Review

  • Gather context
  • Read review skill guidelines
  • Review changed files
  • Post findings

Findings

Blocker (must fix before merge)

  1. Missing unit test for AuthMethodFieldsinternal/agentctl/server/acp/authmethod.go:9
    • Issue: The new shared dispatch function has four branches (Agent, Terminal, EnvVar, zero-value) with no authmethod_test.go. Both callers filter on id == "" && name == "", so an unhandled variant silently drops auth methods from streams and probe layers.
    • Why: This is the exact failure mode the consolidation was meant to prevent — a future SDK variant addition would go unnoticed until runtime. Tests at the single dispatch point are the safety net.
    • Fix: Add authmethod_test.go in internal/agentctl/server/acp/ with table-driven cases for all four variants. Use /tdd to scaffold.

Suggestion (recommended, doesn't block)

  1. Stale telemetry span nameinternal/agentctl/server/acp/client.go:402
    • Issue: Span name is still "request.kill_terminal_command" after the method was renamed to KillTerminal.
    • Fix: Change to "request.kill_terminal" to match every other span in the file.

Previously resolved

  • Duplicated AuthMethod flattener (flagged in first review): consolidated into acpclient.AuthMethodFields in commit 7897ea6. ✅
  • Stale command emit after CloseSession (flagged by CodeRabbit): !a.sessions[sid] guard added in emitAvailableCommandsOnce in commit fc9e67e. ✅

Summary

Severity Count
Blocker 1
Suggestion 1

Verdict: Blocked — add the AuthMethodFields test before merging. The migration itself is clean and correct; all type renames, tagged-union adaptations, and mock-agent stubs look right.

Comment thread apps/backend/internal/agentctl/server/acp/client.go Outdated
Comment thread apps/backend/internal/agentctl/server/acp/authmethod.go
- Span on Client.KillTerminal still read "request.kill_terminal_command"
  after the method rename; switch to "request.kill_terminal" so traces
  match the method label.
- Add table-driven tests for AuthMethodFields covering each variant
  (Agent, Terminal, EnvVar) plus the zero-value case so a future
  upstream variant that we forget to handle surfaces as a test failure
  instead of silently dropping auth methods.

Addresses Claude review on PR #921.
@claude
Copy link
Copy Markdown

claude Bot commented May 16, 2026

Claude finished @carlosflorencio's task in 1m 42s —— View job


Code Review

  • Gather context
  • Review changed files
  • Post findings

Findings

All previously flagged issues have been resolved in this iteration.

Issue Status
Duplicated AuthMethod flattener (flattenAuthMethod / authMethodFields) ✅ Consolidated into acpclient.AuthMethodFields (authmethod.go)
Missing unit tests for AuthMethodFields authmethod_test.go added, covers all 4 branches
Stale span name "request.kill_terminal_command" ✅ Fixed to "request.kill_terminal" (client.go:402)
Stale command emit after CloseSession !a.sessions[sid] guard added at top of emitAvailableCommandsOnce

No new issues found. The implementation is correct throughout:

  • go.mod: replace directive dropped, no agentcooper references remain, coder/acp-go-sdk@v0.13.0 is the only ACP dependency.
  • authmethod.go: Clean dispatch over all three union arms with a silent-drop fallback; well-commented.
  • authmethod_test.go: Table-driven, covers Agent/Terminal/EnvVar/zero-value. Description nil-pointer comparison is handled correctly. Meta key lookups are type-asserted safely.
  • meta_convert.go + acp_executor.go: Both now delegate to acpclient.AuthMethodFields — no duplication.
  • mock-agent/main.go: CloseSession clears both sessions and commandsEmitted maps under mutex; ListSessions/ResumeSession stubs satisfy the wider upstream interface.
  • adapter.go: SetSessionConfigOptionRequest correctly wrapped in ValueId tagged-union variant; UnstableSetSessionModel/UnstableModelId retained intentionally (upstream UnstableSetSessionModelRequest.ModelId still uses the Unstable type).

Verdict: Ready to merge.

The commit-msg hook runs commitlint via `cd apps && pnpm exec`, which
fails in a fresh git worktree because worktrees share `.git/` but not
`apps/node_modules/`. Surfaced as `Command "commitlint" not found` /
`ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL` on the first commit attempt. Hit
during the ACP SDK migration in this PR.
@claude
Copy link
Copy Markdown

claude Bot commented May 17, 2026

Claude finished @carlosflorencio's task in 1m 31s —— View job


Code Review

  • Gather context
  • Read review skill
  • Review changed files
  • Post findings

Findings

No issues found. All previously flagged items have been resolved:

Previously flagged Status
Duplicated AuthMethod flattener (flattenAuthMethod / authMethodFields) ✅ Consolidated into acpclient.AuthMethodFields in authmethod.go
Missing unit tests for AuthMethodFields authmethod_test.go covers all 4 branches (Agent / Terminal / EnvVar / zero-value)
Stale span name "request.kill_terminal_command" ✅ Fixed to "request.kill_terminal" in client.go
Stale command emit after CloseSession !a.sessions[sid] guard added at top of emitAvailableCommandsOnce

The implementation is correct throughout:

  • go.mod: replace directive dropped, no agentcooper references remain, coder/acp-go-sdk@v0.13.0 is the only ACP dependency.
  • authmethod.go: Clean dispatch over all three union arms with a silent-drop fallback; well-commented single point of change.
  • authmethod_test.go: Table-driven, covers Agent/Terminal/EnvVar/zero-value; Description nil-pointer comparison is handled correctly; meta key lookups type-asserted safely.
  • meta_convert.go + acp_executor.go: Both delegate to acpclient.AuthMethodFields — a future SDK variant only needs one update.
  • mock-agent/main.go: CloseSession clears both sessions and commandsEmitted maps under mutex; ListSessions/ResumeSession stubs satisfy the wider upstream interface; emitAvailableCommandsOnce session-closed guard is correctly placed before the commandsEmitted check.
  • adapter.go: SetSessionConfigOptionRequest correctly wrapped in ValueId tagged-union variant; UnstableModelId retained in SetModel calls because upstream UnstableSetSessionModelRequest.ModelId still uses that type.
  • AGENTS.md: Worktrees + commit hooks section mirrors CLAUDE.md — correct and needed for Codex agents.

Summary

Severity Count
Blocker 0
Suggestion 0

Verdict: Ready to merge.

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.

1 participant