* feat(ui): show externally-created sessions in sidebar and Recent view (#1441)
Sessions created by external OpenCode processes (CLI, other server
instances) share the same database but don't broadcast SSE events to
OpenChamber's connected server. The existing 45s global polling via
experimental.session.list() already discovers these sessions, but the
isKnownActiveSessionDirectory filter in SessionSidebar.tsx removes
them when their directory isn't a registered project.
Add effectiveKnownDirectories that extends knownSessionDirectories
with directories derived from globalActiveSessions themselves, so
external sessions pass the filter and appear in the sidebar and Recent
view.
Validated with two live OpenCode server processes sharing the same
database: global experimental.session.list() returns external sessions
immediately, while per-directory APIs do not.
* Revert "feat(ui): show externally-created sessions in sidebar and Recent view (#1441)"
This reverts commit 94acda43ad3049e7674d8eb3f24b1f74acb0d1c3.
* fix(ui): make sidebar reactive to global session store updates (#1441)
Replace non-reactive useGlobalSessionsStore.getState() with direct
reactive subscriptions for activeSessions and archivedSessions. The
previous getState() pattern relied on proxy subscriptions
(activeSessionStructure, hasAuthoritativeGlobalSessions) to trigger
re-renders, which created a fragility gap where store updates could
go unnoticed by the sidebar.
Add a 45s periodic refreshGlobalSessions() interval in the sidebar,
independent of the tray sync hook. The tray sync's polling is gated
behind isTrayPlatform() and isTrayEnabled(), so on runtimes where
the tray is unavailable, there was no periodic refresh of global
sessions at all. External sessions (created by CLI or other server
processes) were only discovered on initial mount or page refresh.
* test: add regression test for stat directory scoping (#3019)
* fix: scope file-reference stat probes to the session directory (#3019)
The /api/fs/stat probe sent by the markdown renderer carried no
directory hint, so the server resolved the workspace from
settings.lastDirectory. When the browsed directory differs from the
session directory the stat returns 400 and the renderer treats it as
file-does-not-exist, silently disabling file-reference links.
Send effectiveDirectory as x-opencode-directory on the probe and
qualify the stat cache key by directory so a rejection under one
directory cannot leak into another. The probe logic moves from
MarkdownRendererImpl into fileReferenceStat with unit coverage.
Opens the chat tab when a new inline comment is submitted
Automatically focuses the chat composer for quicker follow-up
Leaves draft updates unchanged when editing an existing comment
Render managed Chats through the shared folder-aware session group and keep folder ownership at the Chats root, including new drafts and older per-directory scopes.
Hide worktree actions for Chats, make worktree shortcuts inert on Chat drafts, and let new-session shortcuts inherit an active session directory while explicit Chats controls still create managed Chat drafts.
Track Chats and Recent section sentinels so the desktop sticky overlay changes identity only when the corresponding section reaches the top of the sidebar.
Create projectless chat sessions under a managed, date-scoped Chats directory and clean abandoned or deleted session folders.
Add Chats to sidebar state, startup cache, shared context, and Electron Mini Chat while keeping VS Code project-only. Resolve managed chat directories to one server-side memory owner and document the runtime contracts.
Adds a mandatory early load step for the communication-style skill.
Removes the blanket always-on trigger from the skills table.
Clarifies that the guidance applies to all task output.
Adds a new communication-style skill for rewriting text in a more human voice
Replaces the old unslop skill with the new name and guidance
Updates agent instructions to apply the communication-style skill to every task
* feat(skills): remove ClawHub catalog integration
Drop the ClawHub registry as a skills catalog source across web server,
shared UI, VS Code, docs, and locales. The catalog now serves git-based
sources only: the curated Anthropic repo and user-defined repositories.
Also removes the now-unused adm-zip dependency.
* feat(skills): redesign catalog around curated GitHub repositories
Replace the single-source dropdown with a card grid of curated GitHub
repositories (Anthropic, OpenAI, Cursor pstack/skills, Matt Pocock) plus
user-defined sources. Source cards show skill counts, GitHub stars, and
last-updated time; a global search covers all loaded sources.
Server: curated sources gain GitHub repo metadata (stars, pushed_at)
fetched best-effort with a 3-hour in-memory and on-disk cache; scans
run through a concurrency-limited, deduplicated cache with 3-hour TTL
persisted across restarts. Refresh still bypasses the cache.
Shared UI: source cards, global search with clear button, per-skill
GitHub links, install/installed states. VS Code curated list updated
to match. All new copy translated across 12 locales.
* fix(skills): address catalog review findings
- GitHub metadata fetch timeout drops to 1.5s (under the catalog
client's 3s deadline) and failed lookups cache briefly (5 min) so
repeated catalog loads do not re-hit a failing API.
- Disk cache files are written with owner-only permissions (0o600);
rename preserves the mode.
- loadSource deduplicates concurrent in-flight requests per source and
the shared isLoadingSource flag now clears only when the last active
source load finishes.
Defines a process for rewriting text to sound more human
Lists patterns to remove, including AI-style phrasing and overused punctuation
Adds practical guidance for clearer, more direct prose
Plugin providers are registered from a plugin's `config` hook and credentialed
from its `auth` loader, both inside the running OpenCode process. Nothing about
them reaches `opencode.json` or `auth.json`, so resolution that only reads files
could not see them: selecting such a model failed with "has no known API base
URL" while the same model worked in chat (#2666).
`GET /provider` is where that state is visible. A new `runtime-providers`
module keeps one cached snapshot of it and reports, per provider, the
credential and endpoint OpenCode itself resolved. Credential resolution becomes
config -> runtime -> auth.json, and endpoint resolution config -> openai default
-> runtime -> models.dev catalog.
Providers with a dedicated wire format (Copilot, ChatGPT-plan OpenAI, Anthropic,
Google) are excluded from the runtime credential: for them OpenCode reports an
OAuth access token that their real transport does not accept.
opencode zen is excluded when the user has no zen login. OpenCode then reports
the sentinel `apiKey: "public"` and trims its catalog to free models that run on
its own infrastructure; the sentinel is never read as a credential.
Claude Code stays refused for background actions even when a plugin publishes an
OpenAI-compatible endpoint for it, because that endpoint is a facade over the
Claude Agent SDK and spawns the CLI per request.
No capability probe. Asking `GET /models` does identify a plugin whose protocol
lives in its own `fetch`, but measured across the 166 providers with an `api`
URL in the models.dev catalog it also denies six that work and simply have no
`/models` route. A provider that vanishes from the picker explains nothing,
while one that fails on use says why, so availability stops at credential and
endpoint.
The same list drives the Small Model and Changes Walkthrough pickers.
Validated against a real OpenCode with four plugin providers loaded: offered
providers went from 3 to 7, zen and Claude Code stayed out, and a generation
through a plugin-backed model that previously failed now returns.
* fix: reconcile busy sessions after managed OpenCode restart
Forced health-check restarts previously rebound the event stream without
settling in-flight turns, so sessions stayed busy with no terminal state.
Interrupt those sessions, classify health failures, and retain bounded
process diagnostics for post-restart diagnosis.
Fixes#2943
Co-authored-by: serkraser <serkraser@gmail.com>
* fix: surface interrupted chats after OpenCode restart
Complete unfinished assistant turns as aborted once the session is
authoritatively idle, and show a persistent toast so users can continue
instead of remaining silently stranded.
Fixes#2943
Co-authored-by: serkraser <serkraser@gmail.com>
* fix: redact Basic auth credentials in restart diagnostics
The key/value sanitizer stopped at whitespace, so Authorization: Basic
credentials survived in stderr tails and health snapshots. Redact the
scheme token before that rule runs.
Co-authored-by: serkraser <serkraser@gmail.com>
Shows the auth panel only when provider credentials are actually required
Keeps custom providers defined in config from being treated as incomplete
Adds coverage for the new provider auth check
Adds new integrations docs for Claude Code, Command Code, and Cursor
Links the Providers pages to the new integrations guide
Updates the docs sidebar with localized integrations navigation
Share the desktop session-card currency formatter (lib/money.ts) and surface
the current session's cost in the extension chat-header context usage tooltip.
* fix(git): create worktrees from forked PRs via refs/pull/<n>/head fallback
A worktree created from a linked GitHub PR whose head branch lives in a fork
failed when the fork's head repository was missing (deleted fork) or
unfetchable (auth, network): the dialog threw 'PR head repository URL is
unavailable' before any git command ran, and the server had no fallback to
refs/pull/<n>/head, which GitHub serves on the base repository.
- NewWorktreeDialog: when pr.headRepo is absent, send a prRef config
(refs/pull/<n>/head from origin) instead of throwing; the fork config now
also carries prRef so the server can fall back when the fork fetch fails.
- git service: fetchPullRequestHeadRef fetches refs/pull/<n>/head into
refs/remotes/<remote>/pr-<n>-head (same refspec shape as
fetchRemoteBranchRef) and both validateWorktreeCreate and
attachGitWorktreeToCandidate fall back to it when the fork path fails;
fallback worktrees get --no-track and no upstream config because a PR ref
is not pushable. When both paths fail the original fork error surfaces.
- Focused tests cover the prRef-only path and the fork-unreachable fallback.
Fixes#2422
* fix(git): harden PR worktree fallback against stale fork refs (#12)
After a fork fetch fails, resolve immediately from refs/pull/<n>/head
instead of accepting a cached remotes/<fork>/<branch> tracking ref.
Match the PR base repository by URL (not a hardcoded origin remote),
store fetched PR heads under refs/openchamber/pull/<n>/head, and share
one existing-mode resolver between validate and create.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
* fix(git): make PR head SHA authoritative and namespace private refs
Reuse local/remote branches for linked PRs only when their tip matches
pr.headSha; otherwise fall through to fork fetch / refs/pull. Store PR
heads under refs/openchamber/github/<owner>/<repo>/pull/<n>/head, prefer
HTTPS for direct base-repo fallback, and surface composite fork+fallback
errors when both paths fail.
Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
* test(ui): assert validate/create forward deleted-fork PR payload fields
Guards the dialog wiring regression where validate omitted prRef while
create included it, by asserting worktreeManager forwards prRef,
prBaseRepoUrl, and related fields for deleted-fork configs.
Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
* refactor(git): always checkout linked PRs from refs/pull/<n>/head
Move PR worktree resolution to the server. The UI now sends only
pullRequest identity (number + baseRepoUrl + optional head fields);
the server always fetches the authoritative PR head and best-effort
configures fork upstream afterward.
Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
* refactor(ui): drop PrWorktreeConfig; send PR identity only
Delete the prWorktreeConfig module. NewWorktreeDialog maps linked PRs
straight to pullRequest identity, skips upstream defaults for that path,
and leaves checkout + optional fork tracking to the server.
Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
* refactor(git): linked PRs are {number, baseRepoUrl} only
Drop fork upstream / tracking and head/base owner-repo fields from the
linked-PR worktree path. Fetch refs/pull/<n>/head, create --no-track, done.
Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
* fix(git): meet #2422 Must/Should without refs/pull fallback
Linked PRs send fork identity only; the server provisions pr-<owner>,
fetches the head branch, and fails clearly when the fork is missing or
unreachable. Local reuse requires a matching headSha. Prefer HTTPS for
headRepoUrl. Do not write upstream tracking when the upstream ref was
never fetched.
Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
* fix(git): drop invalid upstream fallback and PR branch collisions
Remove setBranchTrackingFallback: if upstream fetch fails, leave tracking
unset. When a linked PR's head branch already exists locally with a
different tip, create pr-<number> instead of git worktree add -b on the
colliding name.
Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
* fix(git): strip PR worktree create back to fork-remote provision (#15)
Keep the original ensureRemoteName/Url path for linked fork PRs, prefer
HTTPS clone URLs, fail clearly when the fork is unreachable, and leave
upstream tracking unset when the upstream ref was never fetched.
Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>