Skip to content

Add 'claude' provider alias, tighten CLI URL parsing, and improve start/send concurrency safety#1

Open
kubobeem wants to merge 4 commits intomainfrom
codex/make-improvements
Open

Add 'claude' provider alias, tighten CLI URL parsing, and improve start/send concurrency safety#1
kubobeem wants to merge 4 commits intomainfrom
codex/make-improvements

Conversation

@kubobeem
Copy link
Copy Markdown
Owner

Motivation

  • Make the SDK compatible with Claude-style (Anthropic) workflows by accepting claude as a provider alias and normalizing it to anthropic across languages.
  • Harden CLI URL parsing and validation to correctly handle bare ports, host:port, and HTTP/HTTPS forms and surface clear errors for invalid values.
  • Fix race/visibility issues around client startup and Session.Send so concurrent starts and context cancellation behave correctly.

Description

  • Added a new docs page docs/integrations/claude-code-compatibility.md and linked it from docs/index.md to document Claude/Anthropic compatibility.
  • Normalized provider.type = "claude" -> "anthropic" in Go (normalizeProviderConfig), Node (normalizeProviderConfig), and Python (_convert_provider_to_wire_format) and extended provider types to include claude in Go/Node/Python type definitions.
  • Strengthened CLI URL parsing in Go (parseCliUrl), Node (parseCliUrl), and Python (_parse_cli_url) to trim input, accept bare port numbers, prepend http:// for parsing, validate port ranges, and raise descriptive errors for invalid formats.
  • Made Go Session.Send respect context cancellation by performing the RPC in a goroutine and selecting on ctx.Done(); updated SendAndWait to propagate context errors.
  • Added concurrent-start deduplication in Node (startPromise) and Python (_start_task with _start_lock) so multiple simultaneous start() calls reuse a single startup flow.
  • Minor import and comment updates to support the above changes and maintain consistent behavior across languages.

Testing

  • Ran Go unit tests and build with go test ./... and the Go build which completed successfully.
  • Ran Node checks including npm test/tsc and integration smoke flows which succeeded.
  • Ran Python tests with pytest and basic runtime checks including type checks which passed.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant