Repository navigation
agentHost: honor managed Assisted approval verdicts - #341889
Conversation
Bundle runtime 1.0.99-1 for desktop and remote. Refresh the managed telemetry schema and assisted-permission recordings for the new judge requests. Preserve tool-call reference mapping and JSON diff escapes in recordings without relaxing strict replay or human-approval assertions. Co-authored-by: Copilot <[email protected]>
Normalize quoted JSON path values without changing escaped file content, and apply the same normalization when comparing recorded and live requests. Cover Windows paths in fenced, indented, and unfenced JSON while retaining negative controls for authored text, permission markers, tool wiring, and diff content. Co-authored-by: Copilot <[email protected]>
Treat the optional separator before a workdir/home placeholder as part of the path, matching Windows a/C:/... prefixes to POSIX a/... captures. Preserve exact diff hunks, authored content, and strict replay with focused cross-platform regression tests. Co-authored-by: Copilot <[email protected]>
Pick up the upstream bottom-panel geometry correction needed by packaged unit tests without changing SDK upgrade behavior. Co-authored-by: Copilot <[email protected]>
Bound placeholder paths at whitespace so subsequent authored expressions cannot be normalized into false matches. Preserve JSON escape spelling outside path tokens instead of parsing and reserializing entire quoted strings. Add external record/replay regression coverage for prose, embedded JSON, Windows paths, literal backslashes and Unicode escape distinctions. Co-authored-by: Copilot <[email protected]>
Consume the derived SDK permission prompt without weakening managed one-time approval or sandbox safeguards. Fixes #341390. 🤖 Authored with GitHub Copilot on behalf of @rwoll. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
Security-sensitive permission correlation and the bundled runtime update need human review and cross-platform validation.
1 open finding
What changed in this PR
Updates Agent Host to honor Assisted approvals for managed requests, addressing #341390 while retaining one-time approval and sandbox restrictions.
Changes:
- Forwards SDK permission context and consumes derived Assisted verdicts.
- Updates SDK/runtime dependencies and managed-permission tests.
- Improves replay normalization for permission-judge requests.
| File | Description |
|---|---|
| src/vs/platform/agentHost/test/node/modelRequestProjection.test.ts | Tests cross-platform diff prefixes. |
| src/vs/platform/agentHost/test/node/e2e/README.md | Documents replay normalization. |
| src/vs/platform/agentHost/test/node/e2e/providers/copilotManagedSettingsAgentHostE2E.integrationTest.ts | Updates Assisted expectations and tool-count assertions. |
| src/vs/platform/agentHost/test/node/e2e/harness/modelRequestProjection.ts | Normalizes placeholder path prefixes. |
| src/vs/platform/agentHost/test/node/e2e/harness/capiReplayProxy.ts | Normalizes judge references and path separators. |
| src/vs/platform/agentHost/test/node/e2e/captures/copilotcli-managed-write-denial-prevents-mutation-under-assisted.yaml | Records judge denial. |
| src/vs/platform/agentHost/test/node/e2e/captures/copilotcli-managed-write-approval-remains-one-time-under-assisted.yaml | Records separate write approvals. |
| src/vs/platform/agentHost/test/node/e2e/captures/copilotcli-managed-read-approval-remains-one-time-under-assisted.yaml | Records separate read approvals. |
| src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts | Verifies permission-context forwarding. |
| src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts | Tests managed approvals and conservative fallbacks. |
| src/vs/platform/agentHost/test/node/capiReplayProxyPathNormalization.test.ts | Tests authored-backslash preservation. |
| src/vs/platform/agentHost/test/node/capiReplayProxy.test.ts | Tests judge-reference normalization. |
| src/vs/platform/agentHost/test/node/__snapshots__/Copilot_SDK_-_managed_settings_bundled_managedSettings_schema_matches_the_snapshot.schema.json | Refreshes bundled schema snapshot. |
| src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts | Forwards SDK callback context. |
| src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts | Uses derived managed Assisted verdicts. |
| remote/package.json | Updates remote SDK/runtime versions. |
| remote/package-lock.json | Locks remote SDK packages. |
| package.json | Updates SDK/runtime versions. |
| package-lock.json | Locks updated SDK packages. |
| .github/skills/policy-and-managed-settings/sdk-runtime-policy.md | Clarifies managed Assisted approval rules. |
Files not reviewed (1)
- remote/package-lock.json: Generated file
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const autoApproval = canUseAssistedApproval && this._lastAppliedPermissionMode === 'assisted' | ||
| ? managedApprovalRequired ? promptRequest?.assistedApproval : await this._takeAutoApproval(toolCallId) |
There was a problem hiding this comment.
Working on addressing this as it's valid.
There was a problem hiding this comment.
Fixed in 28a3153. Both managed and unmanaged Assisted decisions now use only the current callback verdict; the tool-call-level approval cache and waiters are removed. Permission events remain for telemetry and sandbox bookkeeping.
Added the delayed-event regression for requireApproval, missing verdict, and missing callback context. All three reproduced the stale approval before the fix and pass afterward.
Before pushing: the exact Compile & Hygiene workflow command, full-repository ESLint, build typecheck, and cyclic-dependency checks passed; 1,327 unit tests and 12 managed-settings E2E replay tests passed. Also consolidated the inherited duplicate import causing the current CI ESLint failure.
🤖 Authored with GitHub Copilot on behalf of Ross Wollman (@rwoll).
Preserve upstream SDK/runtime versions, schema snapshot and unrelated changes while retaining the managed Assisted consumer fix. 🤖 Authored with GitHub Copilot on behalf of @rwoll. Co-authored-by: Copilot <[email protected]>
999e7bf
Include the concurrently landed changeset comparison fix; the tree is unchanged from the validated merge. 🤖 Authored with GitHub Copilot on behalf of @rwoll. Co-authored-by: Copilot <[email protected]>
Fix TS1117 blocking Compile & Hygiene after merging main. 🤖 Authored with GitHub Copilot on behalf of @rwoll. Co-authored-by: Copilot <[email protected]>
Remove tool-call-level approval caching so a managed approval cannot authorize a later unmanaged permission request. Cover delayed events and missing callback verdicts, and preserve sandbox and managed one-shot guards. Consolidate the duplicate AgentService import inherited from main that was blocking the PR ESLint check. 🤖 Authored with GitHub Copilot on behalf of @rwoll. Co-authored-by: Copilot <[email protected]>

Fixes #341390.
Forward the SDK's derived permission prompt so an approving Assisted verdict permits a managed request once without prompting. Preserve managed one-time restrictions and sandbox safeguards.
lsnow properly goes through to the judge and deny is still respected:🤖 Authored with GitHub Copilot on behalf of Ross Wollman (@rwoll).