Commit 03d9835
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
- .changeset
- apps
- pythinker-code
- dist-web
- assets
- test/tui
- commands
- components/dialogs
- pythinker-web
- src
- api
- daemon
- components/settings
- composables
- client
- i18n/locales/en
- test
- packages
- agent-core-v2
- src/app/flag
- test/app/flag
- agent-core
- src/flags
- test/flags
- agent-gateway
- src
- protocol
- routes
- test
- klient/src/contract/global
- node-sdk/test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments