Context
Verified via spike (2026-05-30, agent-sdk 0.3.158) that claude.ai's web UI sends effort changes to BYOC bridge workers as apply_flag_settings control_requests, with payload:
{
"subtype": "apply_flag_settings",
"settings": { "effortLevel": "low" | "medium" | "high" | "max" }
}
The bridge SDK's internal handleServerControlRequest (in src/bridge/bridgeMessaging.ts) currently only dispatches 5 subtypes:
initialize / set_model / set_max_thinking_tokens / set_permission_mode / interrupt
apply_flag_settings falls through to the default branch → SDK auto-replies with error: "unknown subtype". No inbound callback fires — AttachBridgeSessionOptions exposes onSetModel / onSetMaxThinkingTokens / onSetPermissionMode but no onApplyFlagSettings.
Empirical proof
Same spike also caught these subtypes claude.ai sends but the bridge SDK doesn't expose:
apply_flag_settings (effort changes, 8 fires across two model variants)
get_context_usage (web polls context usage, 6 fires)
set_model extended payload format: "claude-opus-4-7[1m]" (1M context window suffix encoded into model string — already passes through via existing onSetModel, but new syntax)
apply_flag_settings is the highest-value gap — effort is now a real product feature on Opus 4.7+ / Sonnet 4.6+ and sidecode silently no-ops when the user changes it via the web UI.
What sidecode does for now
Nothing. Documented as a known limitation: effort changes on claude.ai do NOT propagate to sidecode bridged sessions; the worker uses its spawn-time default. Revisit on every agent-sdk minor bump.
Acceptance / close conditions
Check node_modules/@anthropic-ai/claude-agent-sdk/bridge.d.ts after each agent-sdk upgrade:
When either ships → wire it in packages/daemon/src/bridge/bridge-transport.ts BridgeInboundHandlers → route through BridgeService.onSetEffort → runtime.query?.applyFlagSettings({effortLevel}). Same pattern as the existing onSetModel wiring.
Notes
- Spike script lived at
spikes/effort-probe.mjs (deleted post-verify, gitignored).
- Verified against current sidecode bridge stack (M2 read-in landed): cse_ session, attach bidirectional, all 7 SDK callbacks wired with logging, 8 effort changes from claude.ai → 0 callback fires → event-log readback revealed the
apply_flag_settings subtype.
Context
Verified via spike (2026-05-30, agent-sdk 0.3.158) that claude.ai's web UI sends effort changes to BYOC bridge workers as
apply_flag_settingscontrol_requests, with payload:{ "subtype": "apply_flag_settings", "settings": { "effortLevel": "low" | "medium" | "high" | "max" } }The bridge SDK's internal
handleServerControlRequest(insrc/bridge/bridgeMessaging.ts) currently only dispatches 5 subtypes:initialize/set_model/set_max_thinking_tokens/set_permission_mode/interruptapply_flag_settingsfalls through to the default branch → SDK auto-replies witherror: "unknown subtype". No inbound callback fires —AttachBridgeSessionOptionsexposesonSetModel/onSetMaxThinkingTokens/onSetPermissionModebut noonApplyFlagSettings.Empirical proof
Same spike also caught these subtypes claude.ai sends but the bridge SDK doesn't expose:
apply_flag_settings(effort changes, 8 fires across two model variants)get_context_usage(web polls context usage, 6 fires)set_modelextended payload format:"claude-opus-4-7[1m]"(1M context window suffix encoded into model string — already passes through via existingonSetModel, but new syntax)apply_flag_settingsis the highest-value gap — effort is now a real product feature on Opus 4.7+ / Sonnet 4.6+ and sidecode silently no-ops when the user changes it via the web UI.What sidecode does for now
Nothing. Documented as a known limitation: effort changes on claude.ai do NOT propagate to sidecode bridged sessions; the worker uses its spawn-time default. Revisit on every agent-sdk minor bump.
Acceptance / close conditions
Check
node_modules/@anthropic-ai/claude-agent-sdk/bridge.d.tsafter each agent-sdk upgrade:AttachBridgeSessionOptionsgainsonApplyFlagSettings?: (settings: Partial<Settings>) => Promise<void> | void(or equivalent)onSetSettings/ per-key callback (onSetEffort?) landsWhen either ships → wire it in
packages/daemon/src/bridge/bridge-transport.tsBridgeInboundHandlers→ route throughBridgeService.onSetEffort→runtime.query?.applyFlagSettings({effortLevel}). Same pattern as the existingonSetModelwiring.Notes
spikes/effort-probe.mjs(deleted post-verify, gitignored).apply_flag_settingssubtype.