Claude code Integration Feature and Integration Tests - #2059
Conversation
|
@adamwrose Did Claude write this? What is the problem this is solving? How would I run it and test it? |
…ns` in tests - Replace custom `contains()` with stdlib `slices.Contains` in tests - Remove redundant `contains` helper function from test file - Add `slices` package import to test file
b6e8cdc to
6ab52ea
Compare
|
@adamwrose Your PR description has a piece of a conversation (with some large language model?) in it....
|
|
I have not forgotten about this. I have been doing research on this for the last couple of weeks. There are opensource projects that expose claude code as a service that fabric and openclaw can talk to. What do you think. Want me to clean this up where AI helped me on the test cases and commit or do you want me to document a way to use claude code with an open source API? |
|
@adamwrose Thanks for your response. I'd love for us to be able to use Tell me what you're thinking, let's discuss! |
- Use exec.CommandContext in SendStream to prevent orphaned processes - Return error on empty prompt instead of silent no-op in Send/SendStream - Add context.Context parameter to SendStream and ListModels - Guard channel send with select/ctx.Done() for graceful shutdown - Strip all ANTHROPIC_* env vars in cleanEnv, not just ANTHROPIC_API_KEY - Log debug warnings for unsupported ChatOptions (Temperature, TopP, etc.) - Truncate prompt in debug logs to avoid noise and sensitive data leakage - Parse and forward token usage metadata from stream events - Add per-test timeouts to integration tests - Add package-level doc comment --- - there is not a --list-models from claude code so I kept the hard-coded list.
claude helped with the testing. |
|
@adamwrose What is the status of this branch? |
…feat/claudecode-integration-tests
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sorry for such a delay. my day job issues have pulled me away but I was able to spend some time on this.
|
What this Pull Request (PR) does
Add an integration to claude code.
I was introduced to your project from NetworkChuck and became facinated with the work of fabric. I currently have an github copilot and claude (Anthropic pro) subscription. I noticed that the anthropic API was charged differently and claude code could use the Subscription vs paying $5 per x many tokens. I hope this will make it to where this is useful for more users with a tighter budget. If you like this, I can make one for opencode as well.
prerequisites
Related issues
Please reference any open issues this PR relates to in here.
If it closes an issue, type
closes #[ISSUE_NUMBER].Screenshots
I have written a lot of tests to validate my work and done some manual testing as well.
Great Work,
Adam