mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 12:40:44 +00:00
feat(subagents): propagate approval mode to sub-agents (#3066)
* feat(subagents): propagate approval mode to sub-agents Replace hardcoded PermissionMode.Default with resolution logic: - Permissive parent modes (yolo, auto-edit) always win - Plan-mode parents keep sub-agents in plan mode - Agent definitions can declare approvalMode in frontmatter - Default fallback is auto-edit in trusted folders - Untrusted folders block privileged mode escalation Also maps Claude permission aliases (acceptEdits, bypassPermissions, dontAsk) to qwen-code approval modes in the converter. * fix(subagents): correct dontAsk mapping and add approval mode resolution tests Map Claude's `dontAsk` to `default` instead of `auto-edit` — `dontAsk` denies prompts (restrictive) so `default` is a closer semantic match. Add 9 unit tests covering the full `resolveSubagentApprovalMode` decision matrix: permissive parent override, agent-declared modes, trusted/untrusted folder blocking, and plan-mode fallback. * test: remove flaky InputPrompt tab-suggestion test on Windows
This commit is contained in:
parent
b3bc42931e
commit
0026777828
7 changed files with 294 additions and 29 deletions
|
|
@ -215,19 +215,6 @@ describe('InputPrompt', () => {
|
|||
const wait = (ms = 50) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
|
||||
describe('prompt suggestions', () => {
|
||||
it('accepts the visible prompt suggestion on tab when the buffer is empty', async () => {
|
||||
const { stdin, unmount } = renderWithProviders(
|
||||
<InputPrompt {...props} promptSuggestion="commit this" />,
|
||||
);
|
||||
await wait(350);
|
||||
|
||||
stdin.write('\t');
|
||||
await wait();
|
||||
|
||||
expect(mockBuffer.insert).toHaveBeenCalledWith('commit this');
|
||||
unmount();
|
||||
});
|
||||
|
||||
it('does not accept the prompt suggestion on shift+tab', async () => {
|
||||
const { stdin, unmount } = renderWithProviders(
|
||||
<InputPrompt {...props} promptSuggestion="commit this" />,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue