Skip to content

Enhance session handling and approval logic with updates#11

Merged
koltyakov merged 3 commits into
mainfrom
dev
May 15, 2026
Merged

Enhance session handling and approval logic with updates#11
koltyakov merged 3 commits into
mainfrom
dev

Conversation

@koltyakov
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 15, 2026 20:15
@koltyakov koltyakov merged commit a667033 into main May 15, 2026
5 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR bumps Varro to 0.17.4 and combines several improvements: handling OpenCode's new session.compacted event, syncing pending permissions when entering full‑access mode, watching OpenCode config/auth files to refresh provider state, and adding a managed OpenCodeServer.restart() (with helpers in OpenCodeProcess to stop stray listeners on the port). It also expands shared OpenCode types (Session/Provider/ModelCapabilities/ModelCost/various session.next.* event payloads) and changes the x-opencode-directory header to send the raw path instead of URL-encoded.

Changes:

  • Wire up session.compacted handling and syncPendingPermissions after switching to full‑permission mode.
  • Add SidebarProvider file watchers for OpenCode config/auth that debounce a providerLimitService cache clear, server restart, and providers/refresh post; introduce OpenCodeServer.restart() with new port/process cleanup helpers in OpenCodeProcess.
  • Expand opencode-types.ts / protocol.ts with new fields, event payload shapes, and the session.compacted server event; send x-opencode-directory as a raw (un-encoded) string.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
package.json Version bump to 0.17.4.
src/shared/protocol.ts Adds session.compacted to SERVER_EVENT_NAMES and its event property type; expands several session.next.* event payloads.
src/shared/opencode-types.ts Adds new optional Session fields, ModelCapabilities/ModelCost, expanded Provider shape, and helper types for tool output / next events.
src/webview/hooks/session/session-event-handlers.ts Adds a session.compacted handler that clears compacting state and resyncs the session.
src/webview/hooks/session/session-approvals.ts After auto-approving in 'full' mode, optionally calls syncPendingPermissions; threaded through dependencies.
src/webview/hooks/runtime/open-code-runtime-instance.ts Passes syncPendingPermissions into SessionApprovalOperations.
src/webview/hooks/session-event-handlers.test.ts Test for the new session.compacted handler.
src/webview/hooks/session-approvals.test.ts Asserts syncPendingPermissions is invoked when switching to full mode.
src/extension/sidebar-provider.ts Adds debounced provider config/auth file watchers that clear cache, restart the server, and post providers/refresh; stores server as a member.
src/extension/sidebar-provider.test-support.ts Mocks vscode.RelativePattern for tests.
src/extension/server.ts New restart() method that tears down state, calls stopServerForRestart(), then re-start()s.
src/extension/open-code-process.ts Exports getOpenCodeConfigPath; adds stopServerForRestart() plus utilities to find/kill OpenCode processes listening on the configured port.
src/extension/commands.ts varro.server.restart now uses server.restart() and posts providers/refresh.
src/extension/rest-proxy.ts Sends x-opencode-directory as a raw directory string (no encodeURIComponent).
src/extension/rest-proxy.test.ts Updated tests to match the raw-header behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants