Commit Graph
1624 Commits
Author SHA1 Message Date
Bohdan Triapitsyn 6cc3a93547 chore: update unreleased changelog 2026-06-12 18:54:35 +03:00
Bohdan Triapitsyn 782bc92b15 Forget unmanaged orphan worktrees safely 2026-06-12 18:36:06 +03:00
Bohdan Triapitsyn ea3bb103eb Restrict orphan worktree cleanup 2026-06-12 18:33:22 +03:00
Bohdan Triapitsyn 106b31a407 Harden remote API security boundaries 2026-06-12 18:24:07 +03:00
Bohdan Triapitsyn c281937406 refactor(recent): replace active-now tracking with recent session window
Replace persisted 'active now' tracking with 48-hour recency window
Remove Zustand ActiveNowStore and localStorage persistence
Simplify session sidebar data flow
2026-06-12 14:34:33 +03:00
Bohdan Triapitsyn 28aeb4950b refactor: simplify session list display
Makes minimal session rows the default
Removes session diff stat badges from navigation surfaces
Keeps expanded session rows in VS Code
2026-06-12 12:38:31 +03:00
Bohdan Triapitsyn c703db2745 fix: stop forwarding client auth to OpenCode and harden home/session state
Packaged desktop showed no sessions in 1.12.4. Root cause: the sanitized
session-list proxy path added in #1538 forwarded the renderer's
"authorization" header (the OpenChamber UI client token) to the managed
OpenCode upstream alongside the managed "Authorization" credential.
OpenCode does not recognize UI client tokens, so every session-list
request answered 401 — only in the packaged app, because only its
renderer (openchamber-ui:// origin) attaches a bearer token; dev web and
dev Electron run same-origin without one. The legacy http-proxy path
overwrote the header correctly, which is why everything except session
lists kept working.

Proxy fix:
- proxy-headers: filter the client "authorization" header out of
  forwarded request headers; the OpenCode upstream must only ever see
  its own managed credentials. Covered by tests.

Desktop cwd:
- electron: launch the managed OpenCode CLI from the user home instead
  of app userData, matching upstream desktop behavior. userData-as-cwd
  made OpenCode treat the app-data folder as a separate empty workspace.

Home directory poisoning loop:
- directoryPersistence: stop replaying localStorage homeDirectory
  through synchronizeHomeDirectory on boot/auth resync. The persisted
  value is only a boot-time cache; replaying it re-wrote stale values
  (e.g. a project path) into desktop settings on every start, overriding
  the authoritative /api/fs/home resolution.
- persistence: never overwrite an injected window.__OPENCHAMBER_HOME__
  with a persisted value.
- useDirectoryStore: host switches happen in place (no reload), so
  re-resolve home from the new runtime's /api/fs/home on endpoint
  change instead of keeping the previous host's value.
- opencode client: only short-circuit to the injected desktop home when
  the active runtime is local; remote runtimes ask /api/fs/home.

Settings hygiene:
- persistSettings: log field names only — change payloads can carry
  credentials (UI password, client tokens, tunnel tokens) that must not
  reach the log file; drop step-by-step log chatter.
- validateProjectEntries: only stat project paths when the incoming
  update actually touches the projects list, not on every settings save.
- remove the write-only approvedDirectories setting everywhere and add
  a migration that strips the stale key from persisted settings.

Tests:
- usePluginsStore.test: register an own runtime-fetch module mock so the
  suite is independent of process-global mock.module leakage from other
  files, and restore globalThis.fetch after the suite.
- persistence.test: clean up the window global created for the suite.
2026-06-12 01:53:38 +03:00
Hristo KaramanlievandBohdan Triapitsyn 9685630436 fix: lighten session list payloads (#1538)
* lighten session list

* fetch full session on open

* sanitize session list

* sanitize global sessions

* preserve revert markers in session lists

* fix: preserve session metadata in list sanitizers

---------

Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
2026-06-11 23:06:19 +03:00
youzini 1c274d0a56 fix(docker): stabilize workspace dependency install (#1533)
* fix(docker): pin bun image

* fix(docker): copy electron workspace manifest

* fix(docker): remove stale desktop manifest copy
2026-06-11 22:00:28 +03:00
youzini abda2bc42b fix(mcp): import opencode mcp config snippets (#1532) 2026-06-11 21:55:38 +03:00
lilyzhaunandlilyzhaun c9cd25d18f fix(ui): keep a close control in empty mobile changes states (#1525)
The newer mobile Changes surface returns early for non-interactive list states (no directory selected, repository status still loading, or current directory is not a Git repository). Those branches rendered only MobileChangesState and skipped the standard header row entirely.

On Android PWA this leaves the sheet with no visible close/back affordance. Because the surface is hosted inside MobileSurfaceShell as a modal sheet, the browser/system back gesture does not reliably dismiss it, so users were forced to tap sparse overlay whitespace to escape.

Fix the regression by wrapping those early-return states in the same top header used by the normal Changes list, including the close button and current path label. This keeps dismissal available even when the new mobile UI is showing an empty/error state. While touching the file, switch the remaining direct @remixicon/react usages in this component to the shared Icon system to match current UI conventions.

Validated with packages/ui type-check and a packages/web build.

Co-authored-by: lilyzhaun <lilyzhaun@users.noreply.github.com>
2026-06-11 21:51:01 +03:00
raz123andBohdan Triapitsyn e20cfa2dbc feat(ui): add cache hit rate to context sidebar last-message token breakdown (#1524)
* feat(ui): add cache hit rate to context sidebar with verified formula

Add a Cache Hit row to the last-assistant-message token breakdown in
the context sidebar. The percentage is computed by the new
computeCacheHitRate utility:

  cache.read / (input + cache.read + cache.write) x 100

The formula was verified against the SDK source
(packages/opencode/src/session/session.ts:getUsage), which reports
input as the non-cached portion only
(totalInputTokens - cacheReadInputTokens - cacheWriteInputTokens).

Also export sumTokenBreakdown from tokenUtils for reuse, and fix the
event-reducer test type errors (setDelta/getText helpers, toBeCloseTo
replacement).

Closes: #

* fix: wire i18n key for Cache Hit label, fix formatNumber type, drop unintended event-reducer changes

* chore: remove unused cacheHitRate and cacheHitRateTooltip i18n keys from en.ts

* fix: correct cache hit token display

* fix: add French cache hit label

---------

Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
2026-06-11 21:43:41 +03:00
284d72bef2 Keep notification SSE stream alive behind proxies (#1516)
* fix: keep notification SSE stream alive

* Fix PR comments

* fix: cover notification stream error cleanup

---------

Co-authored-by: Konstantin Zolin <zolin_ka@vk.com>
Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
2026-06-11 19:48:06 +03:00
Bohdan Triapitsyn f26950fa4e fix: treat gh CLI token as GitHub account 2026-06-11 19:30:19 +03:00
Bohdan Triapitsyn 465732858f fix: clarify GitHub token settings 2026-06-11 18:59:58 +03:00
Bohdan Triapitsyn 6ca99a3d5e fix: add French gh CLI settings translations 2026-06-11 18:46:31 +03:00
Tom Rochette 33e614c76b Fallback to gh CLI credentials if available (#1515)
Adds `gh` CLI as a GitHub credential fallback for users who already have
`gh auth login` configured locally. OpenChamber-owned OAuth credentials
remain the primary source of truth; the `gh` token is only used when no
stored OpenChamber GitHub access token exists and the fallback is not
disabled.

The fallback is implemented as a credential provider only: GitHub features
continue to use the existing Octokit/GitHub API paths for issues, pull
requests, checks, merges, and related operations. The PR does not replace
those endpoints with `gh issue` or `gh pr` CLI commands.

Server changes:
- Add `gh-cli-credential.js` to read `gh auth token` with a bounded timeout.
- Cache the `gh` token lookup for 30 seconds, including negative results,
  to avoid repeated subprocess spawning on status/polling paths.
- Hide the subprocess window on Windows via `windowsHide: true`.
- Clear the gh CLI token cache when the fallback setting changes.
- Update `getOctokitOrNull()` to prefer stored OpenChamber OAuth tokens and
  fall back to the `gh` token only when enabled.
- Add `ghCliDisabled` persistence in the existing settings file with atomic
  writes and `0o600` file permissions.
- Add `POST /api/github/auth/gh-cli` to enable or disable the fallback.
- Extend `/api/github/auth/status` with `ghCli` metadata: availability,
  disabled state, active state, and active user when applicable.

UI/runtime changes:
- Extend `GitHubAuthStatus` and `GitHubAPI` with gh CLI fallback metadata
  and toggle support.
- Add web RuntimeAPI support for toggling the gh CLI fallback through
  `runtimeFetch`, preserving active runtime/remote target behavior.
- Add deterministic VS Code unsupported handling for the gh CLI toggle.
- Update GitHub Settings to show gh CLI availability and active status.
- When gh CLI is the active auth source, show it in the connected account
  card and offer Disable instead of Disconnect.
- Keep Add Account available so users can still connect an OpenChamber OAuth
  account, which then takes priority over gh CLI.
- Add localized gh CLI settings strings across supported settings locales.

Fixes addressed during review:
- Removed unreachable UI branches in the inactive gh CLI card.
- Avoided duplicate and repeated `gh auth token` subprocess calls.
- Hardened settings file permissions for the new persisted flag.
- Routed the gh CLI toggle through the RuntimeAPI/runtimeFetch path instead
  of direct browser `fetch`.
- Added targeted tests for hidden subprocess options and negative-result
  cache behavior.
- Fixed a VS Code webview Response body typing issue that blocked type-check.
2026-06-11 18:43:41 +03:00
Bohdan Triapitsyn 6386b4a404 fix: avoid home cwd for VS Code OpenCode startup 2026-06-11 16:44:45 +03:00
Bohdan Triapitsyn a01b7a982f fix: align VS Code subsession chevrons in metadata row
Moves VS Code subsession chevrons into the metadata row
Centers the chevron with session metadata
Keeps web and desktop sidebar layout unchanged
2026-06-11 13:19:14 +03:00
Gautam0507 4198246671 fix(docker): update COPY path after Tauri desktop removal (#1606)
The Tauri desktop package was renamed to electron in commit c7bc026b.
Update the Dockerfile so workspace paths match bun.lock.
2026-06-11 02:02:51 +03:00
Bohdan Triapitsyn 3e7d3f85c7 fix: show Cursor plan limit progress
Calculates plan limit usage from remaining balance
Restores the Cursor plan limit progress bar
2026-06-11 02:01:53 +03:00
Bohdan Triapitsyn 72d814110a ci: fix bot help command responses 2026-06-11 01:51:04 +03:00
Bohdan Triapitsyn 75014e0317 release v1.12.4 2026-06-11 01:42:41 +03:00
Bohdan Triapitsyn 2362d43036 fix: use correct thinking variant when sending review flow messages 2026-06-11 01:37:03 +03:00
Bohdan Triapitsyn e36085d898 feat: add collapsible user message setting 2026-06-11 01:26:50 +03:00
Bohdan Triapitsyn a6571aa8b7 fix: avoid unnecessary macOS folder prompts on desktop startup
Start managed OpenCode from the app data directory instead of the home folder
Prevent unnecessary Desktop, Documents, Downloads, and Music access prompts
Add coverage for configured OpenCode working directory
2026-06-11 01:06:25 +03:00
kjhqandkjhq 6a4cf33131 fix: add hidden models state to ModelMultiSelect component (#1502)
Co-authored-by: kjhq <example.com>
2026-06-11 00:48:58 +03:00
Bohdan Triapitsyn d29a0c5697 fix: style agent mentions with primary color in markdown messages
Agent @mentions in markdown use the primary accent instead of generic link color
Mentions render without external URL favicons
Markdown mode now matches plain text mention styling
2026-06-11 00:46:34 +03:00
Bohdan Triapitsyn b46153801b feat: add Cursor usage quota tracking
Adds Cursor as a supported quota provider
Reads Cursor auth from env, token files, or local app data
Improves Cursor usage labels in the UI
2026-06-11 00:16:48 +03:00
Maksym Mospanenko 7b33805ea0 feat(vscode): support multi-root workspaces (#1493)
Add proper VS Code multi-root workspace support. New sessions now start in the workspace folder the user chooses instead of always using the first folder.

The VS Code sidebar now shows one shared flat session list for the currently opened workspace folders, keeps that list synced when folders are added or removed, and excludes sessions from worktrees unless that worktree is opened as a workspace folder.

Also keep the OpenCode server process independent from a specific workspace folder so changing the selected folder does not restart or interrupt existing sessions.
2026-06-10 23:58:40 +03:00
Pascal AndréandBohdan Triapitsyn 49a1424e5f feat: add complete French localization (#1482)
* feat: add French locale runtime

Add French to OpenChamber's shared i18n runtime, dictionaries, and parity tests so the existing language picker can load a complete fr locale across shared UI surfaces.

* fix: localize shared UI formatting

Remove remaining shared UI locale hardcodings so dates, numbers, and first-party helper copy follow the active app locale instead of leaking English on French surfaces.

* feat: localize VS Code French surfaces

Localize VS Code bootstrap, native runtime messages, panel titles, and manifest contribution strings so French users get consistent first-party copy across the extension experience.

* fix: TASK-2026-05-30-008 correct French review findings

Fix broken French relative-time and weekday strings reported on PR #1482 and restore proper import order in quota utils without broadening scope.

* fix: TASK-2026-05-30-008 address final PR review comments

Capture the localized More Info label once in the VS Code CLI-missing flow and replace the remaining inline French-only utility strings with dictionary-driven copy plus required locale keys.

* fix: TASK-2026-05-30-008 normalize French glossary

Correct glossary-level French terminology on the live PR branch, keeping canonical technical terms like PR, worktree, stash, HEAD, Mermaid, Markdown, remote, and session while replacing misleading literal translations.

* fix: TASK-2026-05-30-008 refine French terminology pass

Clean up remaining glossary mistakes on the French PR branch, especially around Mermaid, Markdown, PR, worktree, stash, branch, remote, and commit terminology, while keeping behavior unchanged.

* fix: TASK-2026-05-30-008 clean remaining French false friends

Correct the SOCKS5 mistranslation and a final small set of obvious false-friend technical nouns on the French branch without changing behavior.

* fix: TASK-2026-05-30-008 correct French glossary terms

Replace remaining false-friend translations in the French UI dictionaries and normalize technical labels for the French PR branch.

* fix: TASK-2026-05-30-008 remove remaining French Mermaid false friend

Replace the last confirmed Sirène translation with Mermaid and re-run the requested blacklist and build verification on the PR branch.

* fix: TASK-2026-05-30-008 enforce French glossary policy

Keep skill/PR/worktree/remote terminology developer-credible in French and remove remaining machine-translated Git and settings copy.

* fix: TASK-2026-05-30-008 keep prompt terminology in French

Replace remaining technical invite translations with prompt wording across scheduled tasks, multi-run, prompt templates, and Magic Prompts.

* fix: TASK-2026-05-30-008 finalize French terminology cleanup

Polish remaining worktree/remote wording, remove visible metadata leakage, and correct final Git and settings labels on the French PR branch.

* fix: TASK-2026-05-30-008 polish final French strings

Correct the last aria-like artifacts and awkward worktree/remote/GitHub URL phrasing in the French dictionaries.

* fix: TASK-2026-05-30-008 normalize final French glossary framing

Tighten the last worktree/remote/checkout wording and fix remaining French grammar around canonical technical terms.

* fix: TASK-2026-05-30-008 align final developer glossary wording

Normalize the last French framing around canonical developer terms like worktree, remote, prompt, and checkout.

* fix: TASK-2026-05-30-008 harmonize final French sentence framing

Replace the last raw franglais around checkout, remote, worktree, and prompt-facing labels with more natural French framing while keeping the chosen technical terms.

* fix: TASK-2026-05-30-008 add compact relative date keys

Replace French-specific prefix stripping in compact session date labels with dedicated i18n keys across locale dictionaries, preserving existing compact label output while making French wording robust.

* docs: add French documentation

* docs: mention French locale folder

---------

Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
2026-06-10 20:19:30 +03:00
85bf7c7563 fix(opencode): accept non-2xx status codes in probe-url to support redirects (#1471)
Co-authored-by: mdbetancourt <mdbetancourt@users.noreply.github.com>
Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
2026-06-10 18:54:41 +03:00
Bohdan Triapitsyn a486e76233 chore: update runtime requirements
Require Node 22 or newer
Update project package manager to Bun 1.3.14
2026-06-10 17:37:19 +03:00
Tom Rochette 9742b2c777 chore: bump better-sqlite3 from ^11.7.0 to ^12.10.0 in packages/web (#1590) 2026-06-10 17:15:41 +03:00
renovate[bot] 27075a48a1 chore(deps): update cloudflare/cloudflared docker digest to ba461b8 (#1596)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-06-10 17:05:30 +03:00
Bohdan Triapitsyn e3f3da4cb4 fix: restore dependency update compatibility
Fix VS Code webview type-check with TypeScript 5.9
Align ghostty-web to 0.4.0 across the workspace
Refresh ghostty-web patch for the updated package
2026-06-10 17:05:10 +03:00
renovate[bot] 908adc1634 chore(deps): update development dependencies (#1597)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-06-10 16:42:49 +03:00
Bohdan Triapitsyn 82d5bab81d chore: add renovate dependency updates
Add Renovate configuration with release age delay
Document lighter validation for docs and config changes
2026-06-10 16:03:19 +03:00
Bohdan Triapitsyn cc97710f9e fix: show update overlay in mobile layout
Shows the animated logo while OpenCode reloads on mobile
Keeps mobile update behavior aligned with desktop and web
2026-06-10 15:55:54 +03:00
Bohdan Triapitsyn 0c25c4aecb docs: update unreleased changelog entries 2026-06-10 15:39:14 +03:00
Bohdan Triapitsyn 2c0749ef1d fix: align archive all action in VS Code header
Moves the archive all sessions action to the right side of the header
Keeps the sessions title focused on text only
2026-06-10 15:28:24 +03:00
Bohdan Triapitsyn 12c8cbf544 feat: add right-click menus across sidebar rows
Open row actions at the pointer position
Keep three-dot menus working separately
Reuse shared menu styling for consistent visuals
2026-06-10 15:12:10 +03:00
Bohdan Triapitsyn 7a18e79bdb fix: improve Settings search results
Adds Window transparency to Settings search
Keeps Settings search group headers in normal case
2026-06-10 14:11:13 +03:00
Bohdan Triapitsyn c7a43bb8ec ci: add openchamber bot mention commands 2026-06-10 14:01:10 +03:00
Bohdan Triapitsyn fac4167499 test(sync): update stale tests to current pipeline contracts
Four sync tests had been failing for a while (CI doesn't run them, so
nobody noticed). All four asserted behavior that was deliberately
changed by earlier refactors — the production code is correct:

- Three event-pipeline tests still expected message.part.updated events
  to coalesce in the queue. That coalescing was removed in #1167 to
  preserve part update ordering (the new contract is covered by
  event-pipeline.test.ts). Updated the delta-ordering and no-coalescing
  expectations, and switched the routes-before-queueing test to
  session.status, which is still a coalescible type, so it keeps
  proving that coalescing happens on the resolved directory.
- One session-ui-store test expected shell sends to run inside an
  opencodeClient.withDirectory scope. Since #1228 the session directory
  travels as an explicit request param on shellSession; the test now
  asserts that contract directly.

All 165 sync tests pass.
2026-06-10 14:01:10 +03:00
Bohdan Triapitsyn 89aa389e6c fix(tray): show live activity for every session, not just one
The tray showed the busy indicator for at most one session at a time.
Several gaps in how per-session status was sourced stacked up to that:

- Status was derived by iterating each sync child store's session list,
  so a busy session missing from the list (created moments earlier from
  another window, the tray, or the API while session.created raced or
  the list got trimmed) was invisible even though the store's
  session_status map already held its busy entry.
- The upstream /session/status endpoint is directory-scoped — querying
  it without a directory only covers the server's own cwd, so there was
  no authoritative cross-project snapshot to fall back on.
- Status events for directories without a child store were dropped by
  the sync dispatcher, so sessions in unopened projects always rendered
  idle.

Fix, layer by layer:

- Add a cross-project session-status store (sync/global-session-status)
  fed two ways: the sync dispatcher now records status-bearing events
  (session.status / session.idle / session.error) for ALL directories,
  and the tray polls /session/status per visible-session directory to
  seed initial state and reconcile missed events. Snapshots clear stale
  entries both by directory key and by session id, so canonicalized
  (realpath) directory mismatches can't strand a busy entry.
- Read live status straight from each child store's session_status map
  instead of via its session list, and never let one store's idle entry
  clobber another store's busy/retry for the same session.
- Resolve a session as active when either source (child stores or the
  cross-project map) reports busy/retry, instead of letting the synced
  store's idle shadow the fallback.

Verified end-to-end in the dev shell: two sessions running concurrently
in different projects — including a brand-new session in the open
project root, the exact case that failed — now both show busy in the
tray, and both return to idle when they finish.
2026-06-10 14:01:10 +03:00
Bohdan Triapitsyn 079e3a9bd6 feat(settings): add item search (#1592)
Adds item-level search inside Settings so users can find concrete settings like provider auth, agent mode, terminal font size, tunnel options, notification events, and similar controls instead of only filtering top-level pages.
Groups search results by Settings page and shows localized labels plus optional descriptions where useful.
Supports keyboard navigation with Arrow Up/Down, Enter, and Escape, matching the existing autocomplete interaction style.
Opens the correct Settings page or split-page draft state before scrolling to the matching control.
Highlights the matched setting with a subtle token-based background so users can see where they landed without an aggressive outline.
Adds explicit data-settings-item anchors across Settings pages and a centralized search registry with runtime/mobile availability guards.
Updates Settings UI skill guidance so future Settings changes keep search registry entries, anchors, localization, and availability guards in sync.
2026-06-10 12:15:15 +03:00
Bohdan Triapitsyn eff6f46ad9 feat: improve mobile UX (#1591)
Added a mobile MCP overlay so MCP tools can be opened and managed from the mobile UI without relying on desktop-only dropdown behavior.
Improved mobile session panel touch handling so tapping the status/session area opens the right panel reliably on phones and tablets.
Cleaned up mobile usage provider metadata by removing duplicate rows, hiding unset providers, and showing provider logos consistently.
Added eager loading for provider logos used in mobile usage views to avoid delayed or missing icons when the panel opens.
Refined the mobile update and about flows in OpenChamber settings so release/update information is easier to read on small screens.
Adjusted related layout, header, VS Code layout, command palette, and settings text/localization details needed for the mobile polish.
2026-06-10 12:00:10 +03:00
Bohdan Triapitsyn 0153f8787d ci: prevent review bot probe comments 2026-06-10 11:56:53 +03:00
Bohdan Triapitsyn ba786f3b89 ci: fix manual review reaction cleanup 2026-06-10 11:46:26 +03:00