Repository navigation
Description
Prerequisites
- I have searched the existing issues to avoid creating a duplicate
- I am using the latest version of the software
- I can consistently reproduce this issue
Affected Service(s)
Multiple services / System-wide issue (the claude Harness runtime)
Impact/Severity
Minor inconvenience
Bug Description
When an AgentTemplate on a claude Harness has an MCP tool with requireApproval: true and at least one skill, Claude Code runs without the compiled skills.
The driver passes --setting-sources "" --settings <file> --permission-prompt-tool … whenever an approval broker exists (go/harness/claude/internal/driver/process.go:131-137), and always passes the compiled skills as --add-dir <SkillRoot> (:150-154). Claude Code counts skills found under an --add-dir directory's .claude/skills as part of the project setting source, so --setting-sources "" drops them along with the workspace's own settings.
Steps To Reproduce
The pinned Claude Code shows this without model credentials: the system/init event is the first stream-json line and lists the loaded skills.
mkdir -p /tmp/skills/.claude/skills/compiled-skill /tmp/ws && cd /tmp/ws
printf -- '---\nname: compiled-skill\ndescription: d\n---\nx\n' > /tmp/skills/.claude/skills/compiled-skill/SKILL.md
echo '{}' > /tmp/settings.json
probe() {
claude -p hi --output-format stream-json --verbose --strict-mcp-config --dangerously-skip-permissions \
--settings /tmp/settings.json --add-dir /tmp/skills "$@" 2>/dev/null \
| jq -c 'select(.subtype=="init") | [.skills[] | select(. == "compiled-skill")]'
}
probe # as on a turn without approval: ["compiled-skill"]
probe --setting-sources "" # as on a turn with approval: []
probe --setting-sources project # ["compiled-skill"]Expected Behavior
The compiled skills load on every turn, as they do on turns without an approval-gated MCP server.
Actual Behavior
On Claude Code 2.1.260 (PinnedClaudeVersion):
| Flags | compiled-skill in init.skills |
|---|---|
no --setting-sources (turns without approval) |
yes |
--setting-sources "" (turns with approval) |
no |
--setting-sources user |
no |
--setting-sources project |
yes |
--setting-sources local |
no |
Skills under --plugin-dir load with every value.
Proposed fix
Two directions, depending on whether approval turns should stay isolated from ambient config:
-
Same settings loading on every turn (consistent with fix(harness): Disable bare mode for Claude Code #2923): drop
"--setting-sources", ""from the approval branch and keep--settingsand--permission-prompt-tool. The approval still holds, sinceaskwins overallowacross sources. On 2.1.260, withpermissions.ask: ["mcp__<server>__*"]in the--settingsfile, apermissions.allowfor the same server still reached the permission-prompt tool when planted in:CLAUDE_CONFIG_DIR/settings.json, written asmcp__<server>__*,mcp__<server>__<tool>ormcp__<server>;- a trusted workspace's
.claude/settings.json.
An untrusted workspace's
permissions.allowis ignored outright. Checked against a stub Messages API, and on a cluster with aclaudeHarness and an approval-gated MCP server: the call paused atinput-required, with the compiled skill listed on the same turn. -
Keep isolation, and isolate every turn: pass
--setting-sources ""on all turns and deliver compiled skills from somewhere that source does not gate. Of the locations I tried, only--plugin-dirloads with every value, and it renames skills to<plugin>:<skill>.
Option 1 is a one-line change. I can open a PR with it and a driver test asserting --setting-sources is absent.
Environment
- Application version: kagent main (2026-10-01), Claude Code 2.1.260 (the harness image's pinned binary)
- Kubernetes: kind
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsBacklog
Activity
docs(fork): link the approval-turn skills row to kagent-dev#3029
jstar0 commentedon Oct 3, 2026
I noticed the issue description already says you can open a PR for the proposed fix. I missed that before posting my claim; please disregard it. I will defer to your implementation and will not duplicate the work.
EItanya commentedon Oct 16, 2026
Fixed on
mainby #3203. Compiler-selected Claude skills now load through an explicit plugin manifest and--plugin-dir, so they remain available when approval turns disable settings sources.This addresses the dropped-skills path described here. Closing this as resolved; #3191 was also closed as superseded by that fix.
🤖 AI-assisted triage.