fix: allow claude CLI provider to run inside Claude Code sessions#135
Closed
Leeaandrob wants to merge 3 commits intosipeed:mainfrom
Closed
fix: allow claude CLI provider to run inside Claude Code sessions#135Leeaandrob wants to merge 3 commits intosipeed:mainfrom
Leeaandrob wants to merge 3 commits intosipeed:mainfrom
Conversation
Remove CLAUDECODE env var from subprocess environment to allow nesting. Also parse stdout before checking exit code to handle stderr diagnostic noise without losing valid JSON output (same pattern as codex provider).
Remove trailing whitespace and extra newlines flagged by CI fmt-check.
Upstream refactored NewWebSearchTool to accept WebSearchToolOptions struct instead of positional args. Update config_test.go and web_test.go to match the new API.
Collaborator
Author
|
Closing this PR — the fixes here (CLAUDECODE env var removal + stderr resilience) will be included in an upcoming larger PR that refactors the CLI provider architecture entirely. The new PR will:
All changes from this PR are preserved in the new implementation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CLAUDECODEenv var from subprocess environment so Claude Code can be invoked as a subprocess from PicoClaw (or from within another Claude Code session)Problem
When PicoClaw's
claude-cliprovider is used inside a Claude Code session (or any environment whereCLAUDECODEis set), the subprocess fails with:Additionally, if Claude Code writes diagnostic messages to stderr, the non-zero exit code would cause the provider to return an error even when valid JSON output exists on stdout.
Changes
pkg/providers/claude_cli_provider.go: Filter outCLAUDECODEenv var + stdout-first parsingTest plan
go test ./pkg/providers/... -run Claude)gofmtandgo vetclean