Skip to content

feat(sdk): optional token, relative baseUrl, display_name, execution fields#1513

Draft
jsell-rh wants to merge 11 commits intomainfrom
jsell/feat/sdk-consolidated
Draft

feat(sdk): optional token, relative baseUrl, display_name, execution fields#1513
jsell-rh wants to merge 11 commits intomainfrom
jsell/feat/sdk-consolidated

Conversation

@jsell-rh
Copy link
Copy Markdown
Contributor

@jsell-rh jsell-rh commented May 5, 2026

Summary

Consolidates #1508 and #1509 into a single PR with full SDK regeneration.

  • TS SDK templates: Make token and project optional in AmbientClientConfig (browser support)
  • TS SDK templates: Accept relative baseUrl (e.g. /api/proxy), reject protocol-relative URLs (//)
  • TS SDK templates: Sub-resource APIs throw clear error when project is needed but absent
  • Go SDK: Alphabetize ScheduledSessionPatch fields, add AgentID validation in builder
  • All SDKs: Full regeneration needed to pick up display_name on Project and latest spec changes

Supersedes #1508 and #1509.

Test plan

  • TS SDK tests updated (browser mode, relative URL, protocol-relative rejection)
  • make build-generator && make generate-sdk completes
  • make verify-sdk passes (no drift)
  • Go SDK compiles with CLI
  • TS SDK tests pass (45 tests)

Post-merge

After regeneration, watch for Go extension file conflicts (agent_extensions.go, session_messages.go) that depend on client methods.

🤖 Generated with Claude Code

Consolidates PRs #1508 and #1509:
- Make token and project optional in TS SDK templates (browser support)
- Accept relative baseUrl, reject protocol-relative URLs
- Go SDK: add AgentID validation and alphabetize ScheduledSessionPatch fields
- Full SDK regeneration needed (run make generate-sdk)

Supersedes: #1508, #1509

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3bd8c58b-d394-43cd-8e41-a49dacedf58d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jsell/feat/sdk-consolidated
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch jsell/feat/sdk-consolidated

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for cheerful-kitten-f556a0 canceled.

Name Link
🔨 Latest commit 3d0a0da
🔍 Latest deploy log https://app.netlify.com/projects/cheerful-kitten-f556a0/deploys/69fa44684d4e220008f1feaa

@jsell-rh jsell-rh requested a review from markturansky May 5, 2026 16:12
jsell-rh and others added 9 commits May 5, 2026 17:44
…extensions

Full SDK regeneration removed streamingClient, doMultiStatus, and
changed API signatures that hand-written Go extension files and the CLI
depend on. Revert Go and Python SDKs to main, keeping only TS SDK
regeneration and source changes (templates, Go types, tests).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Syncs the Go SDK generator template with the streaming client, multi-status
response handling, and Project() accessor that were added in 55e85ca but
not back-ported to the template. This ensures `make generate-sdk` produces
output compatible with hand-written extension files (session_messages.go,
agent_extensions.go).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ation

The SDK regeneration overwrote hand-written methods in generated files.
This adds extension files (not overwritten by the generator) for:
- ScheduledSession: project-scoped CRUD, Suspend, Resume, Trigger, Runs, GetByName
- Credential: GetToken
- Agent: rename Start→StartInProject to avoid conflict with generated Start

Updates all CLI callers to use the new InProject method names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…patterns

- Rename List/GetInProject → ListByProject/GetByProject to match
  agent_extensions.go convention
- UpdateInProject takes map[string]any (not any) matching agent pattern
- ScheduledSessionPatch includes all 11 fields from the PatchBuilder
- TUI client passes map directly instead of round-tripping through struct

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers ScheduledSession project-scoped CRUD, Suspend, Resume, Trigger,
GetByName, Agent StartInProject, Credential GetToken, doMultiStatus
variadic status check, and Project() accessor.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds tests for gaps found by coverage audit:
- ScheduledSessionAPI.Runs (project-scoped, verifies path and response)
- streamingClient initialization (DisableCompression=true)
- WithInsecureSkipVerify applies to both httpClient and streamingClient
- ScheduledSessionPatch JSON round-trip (all 11 fields, omitempty semantics)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant