Make check-in question create and update reach Basecamp

Merged
RO
2mo ago
+237-37

Problem

basecamp checkins question create was refused by Basecamp every time, with a 422 and "validation error". The SDK sent the schedule's time as hour and minute, but Basecamp reads a question's time on a write only from schedule.time_of_day ("5:00pm"). Without one the schedule fails validation. This has been broken since at least 0.11.0.

checkins question update with --time, --frequency or --days was refused too, for a second reason. Basecamp replaces a question's whole schedule on update and refuses one without its frequency or time, so changing one part of it never worked.

Solution

  • basecamp-sdk v0.23.0 (basecamp/basecamp-sdk#968) gives create and update a QuestionScheduleInput with the fields Basecamp permits, time_of_day among them. This PR bumps to it and resyncs the vendored MCP model snapshot to the same release.
  • --time is validated as before (5:00pm, 5pm, 17:00), now with a range check so 25:00 fails here rather than at the server, and is sent as time_of_day in HH:MM.
  • update reads the question when a schedule flag is given and carries over each part of the schedule no flag changed: frequency, days, time, week instance and start date. The start date matters: an omitted one re-anchors an every-other-week question on today, which can switch which weeks it asks. A title-only update doesn't touch the schedule and makes no extra request.

Checked live on a local bc3 dev and against production (a test project). Create with the default time stores 17:00, and with --time 9:30am stores 9:30. update --time 4:15pm changes only the time and keeps an older start date. update --frequency every_day --days 1,2,3,4,5 keeps the time. The same calls from main answer 422.

Notes

  • --frequency on_certain_days, which the help offers, is refused by Basecamp, whose accepted values don't include it. That's a separate fix to the help text (and to bc3-api's docs).
  • The SDK's UpdateQuestion has the same replace-the-whole-schedule behavior for every SDK user. A merge-safe composite there, like the Todos one, would be the follow-up; until then this PR does the merge in the CLI.

๐Ÿค– Generated with Claude Code


Summary by cubic

Makes basecamp checkins question create and update work with Basecamp. Create was refused with a 422 because the time went as hour and minute, but Basecamp reads a question's time on write from schedule.time_of_day ("5:00pm"). Update with --time, --frequency, or --days was refused because Basecamp replaces the whole schedule on update and rejects one without its frequency or time of day.

Changes

  • Bumps basecamp-sdk to v0.23.0, which adds a QuestionScheduleInput with time_of_day, and resyncs the vendored MCP model snapshot and Nix vendor hash.
  • --time is validated as before, now with a range check so 25:00 fails locally, and accepts 12-hour formats only for hours 1-12. The valid value is sent as time_of_day in HH:MM.
  • Update reads the question when a schedule flag is given and carries over each schedule part no flag changed, including the start date โ€” omitting it re-anchors an every-other-week question on today.
  • An update whose question has no schedule to carry over is refused locally with the flags to pass, rather than sent for Basecamp to refuse.
  • Title-only updates leave the schedule alone and make no extra request.

Separate follow-ups remain: the help text offers --frequency on_certain_days, which Basecamp refuses, and the schedule merge would belong in the SDK for all callers.