Skip to content

fix(skills-intake): isolate the claude reviewer/reviser session (#2491) - #2493

Merged
seoseo-ai merged 3 commits into
mainfrom
fix/2491-intake-handler-claude-isolation
Oct 23, 2026
Merged

seoseo-ai merged 3 commits into
mainfrom
fix/2491-intake-handler-claude-isolation

Conversation

@seoseo-ai

Copy link
Copy Markdown
Collaborator

Closes #2491

문제

skills-intake review/revise 핸들러가 A2A 워커 루트 cwd에서 claude -p를 격리 없이 실행해, 워커 계정의 ~/.claude/CLAUDE.md·SessionStart/Stop hooks(노드 메모리 + Wiki prefetch)·user MCP가 신뢰할 수 없는 후보 스킬이 본문인 세션에 로드됐습니다. a2a-nexus#2422 관측창 FAIL(nosuk 4세션, gongyung 2세션, 마커 2/3/2)의 원인입니다.

변경

  • scripts/skills-intake-review-handler.sh, scripts/skills-intake-revise-handler.sh
    • 에이전트 basename이 claude이면(미설정 기본값 포함) operator args 뒤에 --setting-sources "" --strict-mcp-config를 별도 배열 원소로 추가(빈 값 보존).
    • 핸들러 temp dir 안의 빈 agent-cwd(0700)에서 실행 — 워커 루트 cwd를 상속하지 않음. 상대 경로 bin은 먼저 절대화. 서브셸이 exec timeout이라 $!는 여전히 timeout pid(시그널 전달 유지).
    • 우선순위: REVIEW_AGENT_ARGS에 --setting-sources/--strict-mcp-config가 있으면 operator 값 그대로, 중복 추가 없음.
    • opt-in SKILLS_INTAKE_CLAUDE_SETTING_SOURCES: a2a-nexus A2A_CLAUDE_SETTING_SOURCES의 untrusted-cwd 규칙과 동일 — user만 유지 가능, project/local은 항상 제외, 알 수 없는 값이면 무시(로그).
    • 핸들러는 standalone 설치 파일이라(설치기 --list 4파일 계약) 공용 lib 대신 같은 헬퍼를 두 파일에 두고 "keep in step" 주석.
    • pi/piri/danso 등 다른 에이전트: argv·cwd 불변. tool-lock 검사 불변.
  • scripts/a2a-review-handler.test.sh: +22 checks(review·revise 양쪽) — fake claude가 argv(한 줄 1원소)·pwd -P 기록.
  • changelog.d/2491-intake-handler-claude-isolation.md

검증 (yukson 로컬, origin/main fffef2fb)

  • bash scripts/a2a-review-handler.test.sh → PASS=137 FAIL=0 (기존 115)
  • 뮤테이션: 핸들러 2개만 되돌리면 새 검사 16개 FAIL
  • bash -n 3파일 clean · python3 scripts/changelog_fragments.py check ok · CCC_HARNESS_PHASE=static bash scripts/validate-harness.sh → PASS
  • shellcheck는 로컬 미설치 → CI에서 첫 실행

리스크 / 롤아웃

  • --setting-sources ""는 Claude Code 2.1.305에서 OAuth 정상(a2a-nexus claude-session-isolation.mjs 실측). nosuk·gongyung CLI 2.1.305 확인. 구버전 CLI 노드는 이 플래그 미지원 시 리뷰 실패 가능.
  • user settings(apiKeyHelper/env)로 인증하는 노드는 SKILLS_INTAKE_CLAUDE_SETTING_SOURCES=user 필요.
  • 노드 반영은 install-a2a-review-handler.sh(별도 승인). 수용 기준: 다음 intake transcript에서 CLAUDE.md / session memory / load-memory 마커 0/0/0, verdict 정상.

🤖 Generated with Claude Code

The skills-intake review and revise handlers ran `claude -p` from the
A2A worker root with no isolation, so the worker account's CLAUDE.md,
SessionStart/Stop hooks (node memory + Wiki prefetch) and user MCP
servers loaded into a session whose main content is an untrusted
candidate skill (a2a-nexus#2422 FAIL on nosuk and gongyung).

When the agent basename is `claude` (including the unset default), append
`--setting-sources "" --strict-mcp-config` as separate argv elements after
the operator args and run the agent from an empty private directory inside
the handler's temp dir. Operator --setting-sources/--strict-mcp-config
tokens win; SKILLS_INTAKE_CLAUDE_SETTING_SOURCES=user is an opt-in that
mirrors a2a-nexus A2A_CLAUDE_SETTING_SOURCES (project/local never load).
Other agents keep their exact argv and cwd.

Tests: a2a-review-handler.test.sh 137/137 (+22 checks for both handlers);
reverting only the handlers fails 16 of the new checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@seoseo-ai
seoseo-ai requested a review from jinon86 as a code owner October 23, 2026 07:31
seoseo-ai and others added 2 commits October 23, 2026 16:37
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ctive (#2491)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jinon86 jinon86 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved after exact-head validation and fresh operator authorization using the relay-held jinon86 credential.

@seoseo-ai
seoseo-ai added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 9f7efd5 Oct 23, 2026
14 checks passed
@seoseo-ai
seoseo-ai deleted the fix/2491-intake-handler-claude-isolation branch October 23, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants