Skip to content

feat: expose all Claude Agent SDK options in session creation UI#1179

Open
ambient-code[bot] wants to merge 3 commits intomainfrom
feat/advanced-sdk-options
Open

feat: expose all Claude Agent SDK options in session creation UI#1179
ambient-code[bot] wants to merge 3 commits intomainfrom
feat/advanced-sdk-options

Conversation

@ambient-code
Copy link
Copy Markdown
Contributor

@ambient-code ambient-code bot commented Apr 2, 2026

Summary

Supersedes #1146 (fork branch cannot be updated by the GitHub App integration).

Add a collapsible "Advanced SDK Options" section to the new session page, gated behind the advanced-sdk-options workspace feature flag (disabled by default). Allows users to configure temperature, max tokens, thinking tokens, turn limits, cost budgets, permission mode, allowed tools, system prompt, beta flags, and more.

Data flow: frontend sends sdkOptions → backend serializes into SDK_OPTIONS env var (with server-side allowlist + type validation) → runner parses and merges into adapter options (with defense-in-depth denylist).

Changes

  • Frontend: AdvancedSdkOptions collapsible component with full SDK option controls, JSON preview, client-side validation
  • Backend: filterSdkOptions with type validation, ClearSdkOptions support in UpdateSession, allowlist enforcement
  • Runner: SDK_OPTIONS env var parsing with denylist filtering, system prompt append logic
  • Manifest: sdk-options-manifest.json tracking all ClaudeAgentOptions fields including timeout/inactivity_timeout
  • Tests: Frontend component tests, runner SDK options tests (including denylist filtering)
  • Feature flag: advanced-sdk-options workspace-scoped flag

CodeRabbit Review Feedback (all 13 items addressed)

See commit fix: address all CodeRabbit review feedback on advanced SDK options for details.

Note: The GHA drift-detection workflow (.github/workflows/claude-sdk-options-drift.yml) from #1146 is excluded from this PR due to GitHub App token workflows permission restrictions. It should be added separately by a maintainer.

Test plan

  • go vet ./... passes
  • go build ./... passes
  • npx tsc --noEmit passes
  • npm run build passes
  • pytest tests/test_sdk_options.py — 6/6 pass

Generated with Claude Code

jeremyeder and others added 3 commits April 2, 2026 21:44
Add a collapsible "Advanced SDK Options" section to the new session page,
gated behind the `advanced-sdk-options` workspace feature flag (disabled
by default). Allows users to configure temperature, max tokens, thinking
tokens, turn limits, cost budgets, permission mode, allowed tools, system
prompt, beta flags, and more.

Data flow: frontend sends sdkOptions → backend serializes into
SDK_OPTIONS env var (with server-side allowlist) → runner parses and
merges into adapter options (with defense-in-depth denylist).

Also adds:
- GHA workflow for weekly SDK options drift detection (auto-PR with
  amber:auto-fix label)
- SDK options manifest for tracking ClaudeAgentOptions fields
- Removal of unused create-session-dialog.tsx (dead code)
- Removal of Type column from feature flags settings page
- Tests for frontend component, runner SDK_OPTIONS parsing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix GHA FileNotFoundError message (was misleading about creating manifest)
- Guard against non-dict JSON in SDK_OPTIONS parsing (runner)
- Remove timeout/inactivity_timeout from SDK allowlist (platform-level, not SDK)
- Per-test QueryClient in new-session-view tests (prevent cache leakage)
- Add beforeEach mock reset in advanced-sdk-options tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Drift workflow: fix FileNotFoundError to create initial manifest, detect
  metadata changes (type/required) not just key additions/removals
- Backend: add ClearSdkOptions field for explicit empty SDK options clearing,
  add type/range validation in filterSdkOptions with error returns
- Frontend: rename ambiguous "default" SelectItem to "prompt_user" with
  proper SDK value mapping, add client-side JSON validation for output
  format field, fix toggle logic to treat undefined allowed_tools as
  runner defaults, add source-of-truth comment on DEFAULT_TOOLS
- Runner: add timeout/inactivity_timeout to sdk-options-manifest.json,
  add denylist filtering test

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

ambient-code bot commented Apr 3, 2026

Review Queue Status

Check Status Detail
CI FAIL Go Lint - Backend, Frontend Unit Tests (Vitest), summary +1 more failed
Conflicts pass
Reviews pass

Action needed: Fix failing Go Lint - Backend

Auto-generated by Review Queue workflow. Updated when PR changes.

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