Skip to content

feat: Every SDK includes reason in responses for identity and environment flags - #288

Merged
khvn26 merged 2 commits into
mainfrom
openhands/sdk-spec-v0.10.0
Nov 20, 2026
Merged

khvn26 merged 2 commits into
mainfrom
openhands/sdk-spec-v0.10.0

Conversation

@flagsmithsmith

Copy link
Copy Markdown
Contributor

Contributes to Flagsmith/sdk-spec#27

@flagsmithsmith flagsmithsmith Bot added the sdk-spec Bumps of the Flagsmith SDK behavioural spec label Nov 20, 2026
@codspeed

codspeed Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 15 untouched benchmarks


Comparing openhands/sdk-spec-v0.10.0 (583917a) with main (c0bd2e9)

Open in CodSpeed

SDK spec v0.10.0 checks each flag's `reason` for environment and identity
flags, under remote and local evaluation. The SDK already exposes
`Flag.reason` from both the Flagsmith API and the local engine, so the
spec steps now pass it through.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@flagsmithsmith

Copy link
Copy Markdown
Contributor Author

Spec v0.10.0 checks each flag's reason (STATIC, DEFAULT, TARGETING_MATCH; segment=…) for environment and identity flags, under remote evaluation (Flagsmith 2.294.0 now returns flags[].reason) and local evaluation.

The SDK already supports this. Flag.reason is populated from the API response by Flag.from_api_flag and from the engine result by Flag.from_evaluation_result, and both are covered by unit tests in tests/test_flagsmith.py, tests/test_models.py and tests/test_engine_test_data.py. The 6 failing scenarios failed only because sdk-spec/steps.py didn't include reason in the flags it returns.

Change (583917a): as_spec_flag in sdk-spec/steps.py now returns flag.reason together with feature, enabled and value, as the spec README requires. No library change was needed.

I ran the full spec locally against v0.10.0 (core events local-evaluation) and all 27 scenarios passed. pre-commit (isort, black, flake8) passes too.

🤖 Generated with Claude Code

@flagsmithsmith
flagsmithsmith Bot marked this pull request as ready for review November 20, 2026 19:26
@flagsmithsmith
flagsmithsmith Bot requested a review from a team as a code owner November 20, 2026 19:26
@flagsmithsmith
flagsmithsmith Bot requested review from khvn26 and removed request for a team November 20, 2026 19:26

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Turn on auto-fix | Re-trigger cubic

@khvn26
khvn26 merged commit ca3032a into main Nov 20, 2026
9 checks passed
@khvn26
khvn26 deleted the openhands/sdk-spec-v0.10.0 branch November 20, 2026 19:28
khvn26 pushed a commit that referenced this pull request Nov 23, 2026
🤖 I have created a release *beep* *boop*
---


##
[6.7.0](v6.6.0...v6.7.0)
(2026-11-20)


### Features

* Every SDK includes `reason` in responses for identity and environment
flags
([#288](#288))
([ca3032a](ca3032a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk-spec Bumps of the Flagsmith SDK behavioural spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant