Skip to content

fix: send the slug on feature flag update, so the flag keeps it - #7

Merged
backtrack5r3 (tomflenner) merged 1 commit into
mainfrom
fix/flag-update-sends-slug
Oct 16, 2026
Merged

backtrack5r3 (tomflenner) merged 1 commit into
mainfrom
fix/flag-update-sends-slug

Conversation

@tomflenner

@tomflenner backtrack5r3 (tomflenner) commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR change?

feature_flags.update (sync and async) always sends a slug: the path's by default, or a new one passed as slug=, which renames the flag. In test_contract.py, update-feature-flag moves from forbidden={"slug"} to required={"slug"}, and there is a CHANGELOG entry under Unreleased.

Why?

Kaiten's PUT /feature-flags/{slug} writes the body's slug as the flag's own. The SDK sent none, because the path already names the flag, so every update through the SDK blanked the flag's slug:

  • the flag could no longer be read, updated or deleted through any route;
  • the next such update of another flag failed with a 500 on uq_feature_flags_slug.

Found while building the MCP server on this SDK (kaitencloud/mcp#1). kaitencloud/kaiten#55 fixes the server, so an omitted slug keeps the current one. This change makes the SDK correct against servers on either side of that fix.

I checked every update query in kaiten: flags are the only resource whose update writes the slug. The other resources keep forbidden={"slug"}, and this PR doesn't touch them.

Testing

  • task check: generate:check, ruff, mypy --strict, 748 passed.
  • New test_a_feature_flag_update_keeps_its_slug_unless_renamed: the default sends the path's slug; slug= sends the new one while the PUT still addresses the old.
  • Reproduced live against a local stack: before this change, one update left the flag with slug = ''.

Checklist

  • I have read CONTRIBUTING.md.
  • Every commit in this PR includes a valid DCO Signed-off-by line.
  • I have the right to submit all material in this PR.
  • I have not included secrets or confidential data.
  • I have updated tests where appropriate.
  • I have updated documentation where appropriate.
  • I have preserved required third-party licenses and attributions.

🤖 Generated with Claude Code

feature_flags.update sent no slug, because the path already names the flag.
Kaiten writes the body's slug as the flag's own, so every update through the
SDK blanked it: the flag could no longer be read, updated or deleted, and
the next such update failed with a 500 (kaitencloud/kaiten#55 fixes the
server side).

update now always sends a slug: the path's, or the new one passed as slug=,
which is how a flag is renamed. Flags are the only resource whose update
writes the slug; the others keep ignoring it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: tomflenner <flennertom@gmail.com>
@tomflenner
backtrack5r3 (tomflenner) merged commit c68771e into main Oct 16, 2026
13 checks passed
@tomflenner
backtrack5r3 (tomflenner) deleted the fix/flag-update-sends-slug branch October 16, 2026 17:59
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.

2 participants