Commit 98036e0
committed
fix(core): address round-2 review on declarative agents PR #4842
Two findings:
1. `serializeSubagent` wrote both `permissionMode` and the bridge-derived
`approvalMode` into the same frontmatter block. On the next load the parser
takes `approvalMode` (explicit wins over bridge), so `permissionMode`
silently became dead frontmatter — a user editing it later in the file
would be ignored. Skip the `permissionMode` emit when `approvalMode` is
also being written; `permissionMode` still round-trips when it's the
user's only intent. Two new tests pin both branches.
2. `subagents/index.ts` had a NOTE comment referencing `EFFORT_VALUES` and
`parseEffort` as example schema helpers that intentionally aren't
re-exported. Those symbols were removed during the v1 scope shrink
(637b8b7) and don't exist in the current module. Updated the comment to
reference `claudePermissionModeToApprovalMode`, `parseMaxTurns`, and
`isPermissionMode`, which are the actual current contents.
Sibling-drift note: the same dual-emit pattern exists for `maxTurns` vs
`runConfig.max_turns` — round-X revert (70a876d) explicitly deferred the
`runConfig.max_turns` prune. Not addressed here per that earlier decision.
Refs #48421 parent fabd030 commit 98036e0
3 files changed
Lines changed: 34 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
839 | 839 | | |
840 | 840 | | |
841 | 841 | | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
842 | 865 | | |
843 | 866 | | |
844 | 867 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
620 | 620 | | |
621 | 621 | | |
622 | 622 | | |
623 | | - | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
624 | 628 | | |
625 | 629 | | |
626 | 630 | | |
| |||
0 commit comments