This repository was archived by the owner on Sep 30, 2026. It is now read-only.
Repository navigation
Fix ScheduleWakeup OAuth schema mismatch rejecting every create - #3
Merged
Merged
Conversation
The Anthropic OAuth tool surface advertised a hand-tuned `ScheduleWakeup` schema with `delaySeconds`/`reason`/`prompt`, but the backend `schedule` tool deserializes `task`/`wake_in_minutes`/`wake_at`. Only the tool name is remapped on the wire, not the arguments, so a model calling the advertised params produced an input where serde dropped the unknown fields and `task` defaulted to `None`, failing with "task is required for action=create". Remove `schedule` from the curated OAuth builtin list and from `OAUTH_BUILTIN_LOCAL_TOOLS` so it flows through the generic registry-forwarding path. That advertises the real backend schema (single source of truth) under the mapped name `ScheduleWakeup`, keeping the name allow-list mapping intact while the parameters now match the handler. Add a regression test asserting the OAuth `ScheduleWakeup` schema exposes the backend `task` param and never the fabricated `delaySeconds` param.
This was referenced Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On the Anthropic OAuth (Claude Max subscription) route, every
ScheduleWakeupcreate call failed with:Root cause
The OAuth tool surface remaps a small allow-list of builtin tool names on the wire (
scheduleis advertised to the model asScheduleWakeup). Forschedule, the curated OAuth entry also carried a hand-tuned input schema that did not match the backend:{ delaySeconds, reason, prompt }(all required)schedulehandler deserializes:{ task, wake_in_minutes | wake_at, priority, target, ... }Only the tool name is remapped inbound, never the arguments. So when the model called
ScheduleWakeupwith the advertised params, serde deserialized them intoScheduleToolInput, dropped the unknowndelaySeconds/reason/promptfields, lefttaskasNone, and the handler rejected the call. The tool was unusable on OAuth.Fix
Remove
schedulefrom the curated OAuth builtin list and fromOAUTH_BUILTIN_LOCAL_TOOLS. It now flows through the generic registry-forwarding path used for every other custom tool, which advertises the real backend schema (single source of truth) under the mapped nameScheduleWakeup. The name allow-list mapping (schedule<->ScheduleWakeup) is unchanged, so nothing else about the OAuth contract shifts. This is the minimal, idiomatic fix: it deletes the divergent fabricated schema rather than papering over it with an argument translator.Tests
oauth_forwards_schedule_backend_schema_under_scheduled_wakeup_nameasserts the OAuthScheduleWakeuptool exposes the backendtaskparam and never the fabricateddelaySecondsparam.cargo test -p jcode-provider-anthropic: 12 passed.cargo test -p jcode-app-core --lib schedule: 30 passed (backend accept + wake behavior).cargo clippy -p jcode-provider-anthropic -- -D warnings: clean.Bug reproduced before the fix (live
ScheduleWakeupcall returnedtask is required for action=create) and the reproduction path is now covered by the regression test.Wake behavior (does a scheduled wakeup actually wake an idle session?)
Yes, for
target: "resume"(the default) into a live idle session. The scheduled-item delivery path is:ambient runner -> deliver_scheduled_direct_item -> notify_live_session -> Client::notify_sessionThis is an active re-drive, not a passive notify. The existing test
notify_session_runs_scheduled_task_immediately_for_idle_live_session(incrates/jcode-app-core/src/server/client_actions_tests.rs) confirms that notifying an idle live session injects the scheduled reminder as a user turn AND the model immediately produces assistant output (stop_reasoncycle runs to completion). If the target session is dead rather than live, delivery falls back toresume_dead_session_with_reminder, which loads the session headlessly and runs one capture cycle.So a scheduled wakeup with
target: resumegenuinely re-drives an idle session (wake:true semantics), which is the model-wakeable primitive needed for self-wake. Note:target: ambientis notify-only, andtarget: spawnruns a fresh child session instead of waking the originator; useresumefor self-wake.