fix(vscode): restore permission auto-accept parity

Add a VS Code-specific foreground permission responder while preserving the server-owned implementation for web, desktop, and mobile runtimes.

Persist the authoritative VS Code policy in extension global state and expose matching GET/PUT bridge routes. Broadcast policy updates to the sidebar, session editor panels, and agent manager so every active webview observes the same explicit per-session policy.

Resolve missing child-session lineage through OpenCode, honor nearest explicit ancestor overrides, deduplicate concurrent requests, retry transient replies, and reconcile pending permissions after enablement, bootstrap, and reconnect. Treat resolved requests as handled and route notification suppression through the same responder outcome.

Keep post-toggle reconciliation failures non-fatal after policy persistence and fail closed when lineage or replies cannot be confirmed. Document that auto-accept intentionally cannot run while every OpenChamber webview is closed or suspended.
This commit is contained in:
Bohdan Triapitsyn
2026-07-17 12:59:41 +03:00
parent 65ed6ba0e6
commit 0202e88eb4
17 changed files with 536 additions and 89 deletions
@@ -199,6 +199,16 @@ export class SessionEditorPanelProvider {
}
}
public notifyPermissionAutoAcceptSynced(snapshot: unknown): void {
for (const entry of this._panels.values()) {
entry.panel.webview.postMessage({
type: 'command',
command: 'permissionAutoAcceptSynced',
payload: snapshot,
});
}
}
public notifyWindowFocusChanged(focused: boolean): void {
for (const entry of this._panels.values()) {
entry.panel.webview.postMessage({