Skip to content

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

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

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

Conversation

@flagsmithsmith

@flagsmithsmith flagsmithsmith Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Contributes to Flagsmith/sdk-spec#27
Closes #225

@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 (0f28b55) with main (ccf733c)

Open in CodSpeed

…onment flags

Local evaluation now reports STATIC for flags no segment overrides, and
DEFAULT only when a feature has segment overrides that did not match,
matching flagsmith-engine and Flagsmith's remote responses. Bump
engine-test-data to v3.12.1, which expects these reasons.

The spec steps return each flag's reason.

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

Copy link
Copy Markdown
Contributor Author

Implemented spec v0.10.0 (flag reasons).

What changed

  • Engine (Engine.java): a flag that falls back to its environment default now gets the reason STATIC when no segment overrides the feature, and DEFAULT only when the feature has segment overrides that didn't match. This matches flagsmith-engine (#347) and the reasons Flagsmith ≥ 2.294.0 returns remotely. Both the plain evaluation path and the flag-dependency resolver use the new rule.
  • Engine test data: bumped the submodule from v3.11.0 to v3.12.1. That version expects STATIC, and it adds the unmatched-segment-override DEFAULT case. All 220 engine cases pass.
  • sdk-spec/Steps.java: spec flags now include each flag's reason, read from Flag.getReason(). The SDK already parsed reason from /flags/ and /identities/ responses and set it from local evaluation; the steps just didn't return it.
  • Tests: added unit tests in FeatureStateModelTest for reading reason from an API flag, with and without the field.

Why CI failed: the steps didn't return reason, so every reason column compared as None. Under local evaluation, flags with no segment overrides would also have come back as DEFAULT instead of STATIC.

mvn verify (checkstyle and all 544 tests) passes locally. I haven't run the spec suite locally.

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

@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.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes Nov 21, 2026

@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.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Enables reason in local flag evaluations per sdk-spec v0.10.0, distinguishing STATIC vs DEFAULT fallback reasons, and extends the spec harness and tests. Bounded spec-driven behavior change.

Turn on auto-fix | Re-trigger cubic

Comment thread sdk-spec/Steps.java Resolved
`BaseFlag.getReason()` returns null, and `Flag` overrides it with the
evaluated reason, so callers holding a `BaseFlag` can read the reason
without casting. Default flags have no reason.

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

@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.

0 issues found across 3 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Aligns local flag evaluation reasons with sdk-spec v0.10.0 (STATIC vs DEFAULT), exposes reason on BaseFlag, and updates the spec harness, engine-test data, and tests. Bounded, spec-driven change with tests pinning the behavior.

Turn on auto-fix | Re-trigger cubic

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


##
[8.6.0](v8.5.0...v8.6.0)
(2026-11-23)


### Features

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

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

Surface engine reasons in SDK response objects

1 participant