mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-16 11:15:19 +00:00
feat(core): add shared permission flow for tool execution unification (#3723)
* docs: scaffold branch for #3247 tool execution unification Placeholder commit to establish the branch for PR creation. Actual refactoring will be done in subsequent commits. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * feat(core): add shared permission flow for tool execution unification This addresses #3247 by consolidating duplicated tool execution behavior across Interactive, Non-Interactive, and ACP modes behind shared execution utilities. - Add permissionFlow.ts: shared L3→L4 permission evaluation logic - Add permissionFlow.test.ts: comprehensive test coverage (17 tests) - Export from index.ts for use across all execution modes Why: Permission handling logic was duplicated in CoreToolScheduler and Session.runTool(). This shared module ensures consistent behavior across all modes and provides a single source of truth for future fixes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(e2e): add bundle step to E2E workflow and fix canUseTool test - Add 'npm run bundle' to E2E workflow so dist/cli.js exists for SDK tests - Fix 'should handle control responses when stdin closes before replies' test: - Use helper.getPath() for absolute file path - Make prompt explicitly invoke write_file tool - Remove inputStreamDonePromise timeout that caused false failures - Add q.endInput() to signal stdin done - Assert canUseTool was called and file content is updated * fix(core): wire evaluatePermissionFlow() and address PR review feedback Address review feedback on PR #3723: - Wire evaluatePermissionFlow() in coreToolScheduler.ts (both call sites) - Wire evaluatePermissionFlow() in Session.ts (ACP mode) - Delete TOOL_EXECUTION_UNIFICATION.md (had literal \n artifacts) - Add PermissionFlowPermission union type for stronger typing - Document the 'default' permission state in docstring - Use needsConfirmation/isPlanModeBlocked/isAutoEditApproved helpers --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
3ee90b7f52
commit
4cd9f0cbe4
7 changed files with 461 additions and 95 deletions
8
.github/workflows/e2e.yml
vendored
8
.github/workflows/e2e.yml
vendored
|
|
@ -45,6 +45,10 @@ jobs:
|
|||
run: |-
|
||||
npm run build
|
||||
|
||||
- name: 'Bundle CLI for E2E tests'
|
||||
run: |-
|
||||
npm run bundle
|
||||
|
||||
- name: 'Set up Docker'
|
||||
if: |-
|
||||
${{ matrix.sandbox == 'sandbox:docker' }}
|
||||
|
|
@ -103,6 +107,10 @@ jobs:
|
|||
run: |-
|
||||
npm run build
|
||||
|
||||
- name: 'Bundle CLI for E2E tests'
|
||||
run: |-
|
||||
npm run bundle
|
||||
|
||||
- name: 'Run E2E tests'
|
||||
env:
|
||||
OPENAI_API_KEY: '${{ secrets.OPENAI_API_KEY }}'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue