Skip to content

agentHost: honor managed Assisted approval verdicts - #341889

Merged
Ross Wollman (rwoll) merged 10 commits into
mainfrom
agents/fix-managed-assisted-permissions
Oct 16, 2026
Merged

Ross Wollman (rwoll) merged 10 commits into
mainfrom
agents/fix-managed-assisted-permissions

Conversation

@rwoll

@rwoll Ross Wollman (rwoll) commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

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.

ls now properly goes through to the judge and deny is still respected:

Screenshot 2026-10-15 at 5 09 19 PM

🤖 Authored with GitHub Copilot on behalf of Ross Wollman (@rwoll).

roblourens and others added 6 commits October 15, 2026 13:30
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]>
Base automatically changed from roblou/agents/bump-copilot-sdk-version to main October 15, 2026 23:49
@rwoll
Ross Wollman (rwoll) marked this pull request as ready for review October 16, 2026 00:08
Copilot AI balanced review requested due to automatic review settings October 16, 2026 00:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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.

Comment on lines +6230 to +6231
const autoApproval = canUseAssistedApproval && this._lastAppliedPermissionMode === 'assisted'
? managedApprovalRequired ? promptRequest?.assistedApproval : await this._takeAutoApproval(toolCallId)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on addressing this as it's valid.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

roblourens
roblourens previously approved these changes Oct 16, 2026
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]>
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]>
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: a7e1fc08 Current: d892138d

Changed (1)

sessions/sessionActivityBar/sessionActivityBar/SubmenuOpen/Light
Before After
before after

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]>
@rwoll
Ross Wollman (rwoll) merged commit a32f4c9 into main Oct 16, 2026
49 checks passed
@rwoll
Ross Wollman (rwoll) deleted the agents/fix-managed-assisted-permissions branch October 16, 2026 22:05
@vs-code-engineering vs-code-engineering Bot added this to the 1.143.0 milestone Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assisted Permissions mode in Enterprise Managed environments not working alongside disableBypassPermissionsMode

6 participants