Commit Graph

5 Commits

Author SHA1 Message Date
cnzgray
33a94d2bc4 fix(executor): isolate CLAUDE_CODE_TMPDIR for nested claude to fix (no output) (#154)
* fix(executor): isolate CLAUDE_CODE_TMPDIR for nested claude to fix (no output)

Claude 2.1.45+ calls Nz7() in preAction to clean its tasks directory on
startup. When claude runs as a nested subprocess, it deletes the parent
session's *.output files, causing the parent to read an empty string and
display "(no output)".

Fix: assign each nested claude process its own unique CLAUDE_CODE_TMPDIR
(os.TempDir()/cc-nested-<pid>-<ns>) so it only cleans its own tasks
directory and never touches the parent's output files.

* fix(executor): use MkdirTemp for nested tmpdir

---------

Co-authored-by: cexll <evanxian9@gmail.com>
2026-02-27 22:15:19 +08:00
lza
5fe8c24f55 fix(executor): unset CLAUDECODE env to prevent nested session rejection
Claude Code v2.1.41+ sets CLAUDECODE=1 in all child Bash processes and
rejects startup when the variable is present. When codeagent-wrapper
spawns `claude -p` as a subprocess, it inherits this variable and gets
blocked with "cannot be launched inside another Claude Code session".

Add UnsetEnv method to commandRunner interface and strip CLAUDECODE
before spawning the claude backend.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 07:56:25 +08:00
cexll
cd3115446d fix(codeagent-wrapper): improve CI, version handling and temp dir
- CI: fetch tags for version detection
- Makefile: inject version via ldflags
- Add CODEAGENT_TMPDIR support for macOS permission issues
- Inject ANTHROPIC_BASE_URL/API_KEY for claude backend

Generated with SWE-Agent.ai

Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai>
2026-01-28 11:55:55 +08:00
cexll
2c0553794a fix: Windows compatibility and flaky benchmark test
- Use cmd.exe /c to execute .bat/.cmd on Windows
- Set USERPROFILE alongside HOME for os.UserHomeDir()
- Use setTempDirEnv to set TEMP/TMP on Windows
- Replace chmod-based tests with cross-platform alternatives
- Fix concurrent speedup benchmark with fair comparison
- Add output/ to gitignore

Generated with SWE-Agent.ai

Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai>
2026-01-26 21:29:54 +08:00
cexll
326ad85c74 fix: use ANTHROPIC_AUTH_TOKEN for Claude CLI env injection
- Change env var from ANTHROPIC_API_KEY to ANTHROPIC_AUTH_TOKEN
- Add Backend field propagation in taskSpec (cli.go)
- Add stderr logging for injected env vars with API key masking
- Add comprehensive tests for env injection flow

Generated with SWE-Agent.ai

Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai>
2026-01-24 15:20:29 +08:00