Skip to content

Commit 03d9835

Browse files
authored
feat(meta): expose effective experimental flag state and show it in Lab (#235)
## Related Issue No issue. Third step of the subagent routing work. Stacked on #234 (merge #234 first; this diff includes its commit until then). ## Problem `GET /meta` flattened experimental flags to booleans. The Lab tab showed the saved `[experimental]` value, so when `PYTHINKER_CODE_EXPERIMENTAL_*` (or the master switch) decided a flag, the switch and the runtime disagreed with no explanation. ## What changed - `FlagService.explain()` carries two server-decided fields: `externallyControlled` (`source` is `env` or `master-env`) and `overridden` (a saved value exists and differs from the effective value). Nothing is inferred in the UI. - `GET /meta` adds `experimental_flag_states[]` (`id`, `enabled`, `source`, `config_value?`, `default_enabled`, `externally_controlled`, `overridden`) beside the existing boolean map (additive). - Web: the meta client maps the list (`toAppExperimentalFlagStates`), workspace state stores it on every `/meta` refresh, `usePythinkerWebClient` exposes `experimentalFlagStates` / `experimentalFlagState(id)`, and the Lab rows show `Environment controlled` and `Saved setting overridden` chips independently. The switch still edits the saved setting. - klient `flags` contract mirrors the two fields (contract parity test). - `dist-web` rebuilt from source. Tests: core `explain()` matrix (env+config agree → controlled only; env overrides config → both; master-env; config → neither); gateway `/meta` three cases; web mapper unit test; workspace-state stores the list; Settings chips each independently and none for `source=config`. ## Checklist - [x] I have read the [CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md) document. - [ ] I have linked a related issue (external PRs: the issue must have a maintainer's `/approve`). - [x] I have added tests that prove my feature works. - [x] Ran `gen-changesets` skill, or this PR needs no changeset. - [x] Ran `gen-docs` skill, or this PR needs no doc update. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Lab settings now show when experimental options are controlled by the environment or differ from saved settings. * Experimental feature status is refreshed after configuration changes. * **Bug Fixes** * Prevented outdated server information from replacing newer settings data. * Disabling the secondary-model pin now saves correctly. * **Chores** * Updated the web application build and release metadata. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 8959522 commit 03d9835

121 files changed

Lines changed: 783 additions & 314 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@pymodel/pythinker-code": minor
3+
---
4+
5+
The Lab settings show when an experimental flag is controlled by the environment and when the saved setting is overridden.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"sourceHash": "de035986f5cd2b25cb86fe5a4fccb3b7cace86f47da191388a3b2485f2fc0093",
2+
"sourceHash": "c3559f1b350b84cd73183ecca48c451946874033acb7af4738de205fdd4e4f7d",
33
"sourceFileCount": 405
44
}

apps/pythinker-code/dist-web/assets/CodeBlockNode-BHxsDepl.js renamed to apps/pythinker-code/dist-web/assets/CodeBlockNode-DRvGmu0B.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/DesignSystemView-DYIVh4E3.js renamed to apps/pythinker-code/dist-web/assets/DesignSystemView-CVU88etb.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/Tooltip-CjDZkfwL.js renamed to apps/pythinker-code/dist-web/assets/Tooltip-Dwp18XKI.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-CmvdyVev.js renamed to apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-CpEdlyYv.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/arc-DKF6QHIp.js renamed to apps/pythinker-code/dist-web/assets/arc-C__I0s6O.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/architectureDiagram-5GKGNRK7-piSGt784.js renamed to apps/pythinker-code/dist-web/assets/architectureDiagram-5GKGNRK7-D-HOppuj.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)