Skip to content

fix(assistant): normalize executor ID to kind for SOP sandbox helper - #1523

Open
wcy12378 wants to merge 1 commit into
Tencent:mainfrom
wcy12378:pi-workbuddy/lf1518-claude-sandbox
Open

wcy12378 wants to merge 1 commit into
Tencent:mainfrom
wcy12378:pi-workbuddy/lf1518-claude-sandbox

Conversation

@wcy12378

Copy link
Copy Markdown

fix(assistant): normalize executor ID to kind for SOP sandbox helper

This is the #1518 slice: make "let the agent choose the sandbox" work for accounts configured with Claude Code only.

Problem

The built-in Claude executor has ID claude but kind claude-code — the only built-in whose ID differs from its kind. runSOPHelper passed the SOP default executor ID into credential/runner helpers that key off the kind (assistant_sop_sandbox.go:53,60-61). An account with a valid Claude Code key therefore got empty credentials at :78, sandbox selection returned empty, and the run silently fell back to generic-docker (#1518).

The working-branch path already passes a kind, so it was unaffected.

Change

  • internal/httpapi/assistant_sop_sandbox.go — at the start of runSOPHelper, normalize a built-in executor ID to its Kind via repo.BuiltInExecutor(executor).Kind. Other executors (ID == Kind) and the already-kind path are unchanged.
  • Test covers: an account with only a Claude Code key selects the candidate sandbox (RED: generic-docker fallback / GREEN: chosen sandbox), and the no-credential fallback still behaves as before.

No front-end change; no credential-model change.

Verification (Linux/amd64, Docker python:3.12-slim)

  • 2 targeted tests RED→GREEN.
  • Related httpapi sandbox / working-branch / CodeBuddy and engine SOP regressions: PASS.
  • go vet, git diff --check, secret scan: clean. Windows cannot compile (Linux-specific syscalls), so Go tests were cross-compiled and run in the container with public embed resources from a sibling worktree.

Scope / notes

The built-in Claude executor has ID 'claude' but kind 'claude-code' — the
only built-in whose ID differs from its kind. runSOPHelper passed the SOP
default executor ID into credential/runner helpers that key off the kind, so
an account with a valid Claude Code key still got empty credentials and the
automatic sandbox selection silently fell back to generic-docker (Tencent#1518).

Normalize built-in executor IDs to their Kind at the start of runSOPHelper.
Other executors (ID == Kind) and the already-kind working-branch path are
unchanged.

Part of Tencent#1518; does not close the issue.
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