fix: Align token usage metrics for both Claude and Codex#1943
fix: Align token usage metrics for both Claude and Codex#1943juliusmarminge merged 2 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
88a4d08 to
75b5cea
Compare
75b5cea to
e9cfd8e
Compare
ApprovabilityVerdict: Needs human review This PR changes runtime behavior for token usage metrics tracking, introducing clamping logic and modifying how accumulated tokens are calculated. An open review comment identifies a potential bug where removed type guards could allow NaN values to corrupt token tracking state. You can customize Macroscope's approvability policy. Learn more. |
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Dismissing prior approval to re-evaluate f0ad5d5
There was a problem hiding this comment.
🟢 Low
In maxClaudeContextWindowFromModelUsage, the new implementation removes defensive runtime type checks for value.contextWindow. If the SDK returns malformed data where contextWindow is undefined or NaN, the function returns NaN instead of undefined. This corrupts context.lastKnownContextWindow (line 1330) since NaN !== undefined passes, causing silent degradation of token usage tracking. Consider restoring the type and finiteness checks to ensure malformed values are treated as undefined.
🤖 Copy this AI Prompt to have your agent fix this:
In file apps/server/src/provider/Layers/ClaudeAdapter.ts around line 277:
In `maxClaudeContextWindowFromModelUsage`, the new implementation removes defensive runtime type checks for `value.contextWindow`. If the SDK returns malformed data where `contextWindow` is `undefined` or `NaN`, the function returns `NaN` instead of `undefined`. This corrupts `context.lastKnownContextWindow` (line 1330) since `NaN !== undefined` passes, causing silent degradation of token usage tracking. Consider restoring the type and finiteness checks to ensure malformed values are treated as undefined.
Evidence trail:
apps/server/src/provider/Layers/ClaudeAdapter.ts lines 277-290 (REVIEWED_COMMIT) - new implementation without defensive checks
git_diff MERGE_BASE..REVIEWED_COMMIT showing old code had: `typeof contextWindow !== "number" || !Number.isFinite(contextWindow) || contextWindow <= 0` checks that are now removed
apps/server/src/provider/Layers/ClaudeAdapter.ts lines 1328-1330 (REVIEWED_COMMIT) - shows `if (resultContextWindow !== undefined)` check that would pass NaN
apps/server/src/provider/Layers/ClaudeAdapter.ts line 1340, 1345, 2025, 2057 - shows lastKnownContextWindow is used in token tracking
JavaScript Math.max() behavior: Math.max(0, undefined) returns NaN
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f0ad5d5. Configure here.
Upstream additions: - fix: Align token usage metrics for both Claude and Codex (pingdotgg#1943) - fix(web): allow concurrent browser tests to retry ports (pingdotgg#1951) - fix: quote editor launch args on Windows for paths with spaces (pingdotgg#1805) - Coalesce status refreshes by remote (pingdotgg#1940) - chore(desktop): separate dev AppUserModelID on Windows (pingdotgg#1934) - feat(web): add extensible command palette (pingdotgg#1103) Fork adaptations: - Took upstream's extensible command palette (replaces fork's simpler version) - Took upstream's extracted thread sort logic (Sidebar.logic.ts → lib/threadSort.ts) - Inline ModelUsage/NonNullableUsage types (not yet re-exported from SDK) - Updated claude-agent-sdk to 0.2.104 - Made Thread.archivedAt required (matches upstream)
Upstream additions: - fix: Align token usage metrics for both Claude and Codex (pingdotgg#1943) - fix(web): allow concurrent browser tests to retry ports (pingdotgg#1951) - fix: quote editor launch args on Windows for paths with spaces (pingdotgg#1805) - Coalesce status refreshes by remote (pingdotgg#1940) - chore(desktop): separate dev AppUserModelID on Windows (pingdotgg#1934) - feat(web): add extensible command palette (pingdotgg#1103) Fork adaptations: - Took upstream's extensible command palette (replaces fork's simpler version) - Took upstream's extracted thread sort logic (Sidebar.logic.ts → lib/threadSort.ts) - Inline ModelUsage/NonNullableUsage types (not yet re-exported from SDK) - Updated claude-agent-sdk to 0.2.104 - Made Thread.archivedAt required (matches upstream) - Removed duplicate commandPalette.toggle keybinding
Upstream additions: - fix: Align token usage metrics for both Claude and Codex (pingdotgg#1943) - fix(web): allow concurrent browser tests to retry ports (pingdotgg#1951) - fix: quote editor launch args on Windows for paths with spaces (pingdotgg#1805) - Coalesce status refreshes by remote (pingdotgg#1940) - chore(desktop): separate dev AppUserModelID on Windows (pingdotgg#1934) - feat(web): add extensible command palette (pingdotgg#1103) Fork adaptations: - Took upstream's extensible command palette (replaces fork's simpler version) - Took upstream's extracted thread sort logic (Sidebar.logic.ts → lib/threadSort.ts) - Inline ModelUsage/NonNullableUsage types (not yet re-exported from SDK) - Updated claude-agent-sdk to 0.2.104 - Made Thread.archivedAt required (matches upstream) - Removed duplicate commandPalette.toggle keybinding - Gate sidebar shortcuts when command palette is open (CodeRabbit review)
Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
…service Adapted from upstream t3code pingdotgg#1943 and pingdotgg#1541. normalizeClaudeTokenUsage now clamps usedTokens to contextWindow when it exceeds it, and includes totalProcessedTokens in the snapshot when it differs. Added isTodoTool and extractPlanStepsFromTodoInput to emit turn.plan.updated events during TodoWrite input streaming and content_block_stop. Created ProviderStatusCache Effect service (in-memory Ref-backed cache) for future use.
commit 1efde7d7bdd26a5fbf5e7f1cb5604826bb88e513 Author: Youpele Michael <[email protected]> Date: Tue Apr 14 19:01:21 2026 +0200 Improve spacing in fork-upstream-adapter.md Insert blank lines for readability in .opencode/agents/fork-upstream-adapter.md: add an empty line after the "You should handle requests when:" heading and after the "After implementing:" heading to improve section separation. commit bf270f3543b42dcd2ce56dbf4b2c39c42d2bfd09 Author: Youpele Michael <[email protected]> Date: Tue Apr 14 18:59:06 2026 +0200 Added Windows editor arg quoting and git status refresh after worktree bootstrap Adapted from upstream t3code #1805 and #2005. launchDetached now quotes each arg with double quotes on Windows (shell: true) to handle paths with spaces. Added refreshGitStatus call after worktree creation in wsBootstrap and after branch rename in ProviderCommandReactorSessionOps. Updated ProviderCommandReactor test to include GitStatusBroadcaster mock. commit 21a1b21441a4deec10ac6fb1148c41f1b247fb22 Author: Youpele Michael <[email protected]> Date: Tue Apr 14 18:58:53 2026 +0200 Coalesced git status refreshes by remote and changed terminal.split shortcut Adapted from upstream t3code #1940. Replaced StatusUpstreamRefreshCacheKey (per-ref) with StatusRemoteRefreshCacheKey (per-remote) so sibling worktrees sharing the same remote share a single git fetch instead of each triggering a refspec-scoped fetch. Updated tests to match coalesced behavior. Changed terminal.split keybinding from mod+d to mod+shift+g. commit bfca9cfc2df8fc4cb973b3798b077ab0a4c98e24 Author: Youpele Michael <[email protected]> Date: Tue Apr 14 18:58:45 2026 +0200 Fixed lost provider session recovery by gating on live session existence Adapted from upstream t3code #1938. Moved resolveActiveSession call before the existingSessionThreadId check in ensureSessionForThread, so the reactor no longer treats stale projected session state as an active session. Added gitStatusBroadcaster to SessionOpServices and refreshLocalStatus call after branch rename in maybeGenerateAndRenameWorktreeBranchForFirstTurn. commit 2be6759e1d09b0732a389bdedfe433c8fc6cef17 Author: Youpele Michael <[email protected]> Date: Tue Apr 14 18:58:39 2026 +0200 Added token clamping, TodoWrite plan events, and ProviderStatusCache service Adapted from upstream t3code #1943 and #1541. normalizeClaudeTokenUsage now clamps usedTokens to contextWindow when it exceeds it, and includes totalProcessedTokens in the snapshot when it differs. Added isTodoTool and extractPlanStepsFromTodoInput to emit turn.plan.updated events during TodoWrite input streaming and content_block_stop. Created ProviderStatusCache Effect service (in-memory Ref-backed cache) for future use. commit aaccef1d007cbf93c0345f3a67ac02563b206299 Author: Youpele Michael <[email protected]> Date: Tue Apr 14 18:58:31 2026 +0200 Improved shell PATH hydration with candidate iteration, launchctl fallback, and PATH merging Adapted from upstream t3code #1799. Adds listLoginShellCandidates, mergePathEntries, and readPathFromLaunchctl to @bigcode/shared/shell. Updated fixPath() in os-jank to iterate over shell candidates with per-shell error logging, merge shell PATH with inherited PATH (shell entries first, deduped), and fall back to launchctl on macOS when all shell reads fail. commit 49d758876b3b8b2abc49fdf16256c9befc4e7113 Author: Youpele Michael <[email protected]> Date: Tue Apr 14 14:10:17 2026 +0200 Added: Upstream sync infrastructure for t3code fork adaptation - Created fork-upstream-adapter subagent enforcing read → understand → adapt → verify workflow - Added Upstream Sync section to AGENTS.md documenting bigCode's intentional divergence from t3code - This infrastructure prevents direct copy-paste transplants and ensures changes are properly adapted to bigCode conventions (Effect patterns, subpath imports, package roles) commit a382aeb0c1a63ddece6a96879aa2b26b488586ad Author: Youpele Michael <[email protected]> Date: Tue Apr 14 14:02:04 2026 +0200 Squashed commit of the following: commit 22ae871ea564f47a239a1736335d9ecd844f6b1e Author: Youpele Michael <[email protected]> Date: Mon Apr 13 02:57:27 2026 +0200 Fixed packaged desktop app backend crash by inlining JS deps and symlinking _modules - Changed server tsdown config to bundle all dependencies except native addons (node-pty) and packages needing runtime require.resolve (@github/copilot-sdk) into a self-contained bin.mjs - Updated desktop artifact build to install only external deps via npm, then rename node_modules to _modules (electron-builder strips node_modules) - Added ensureBackendModulesSymlink() in desktop main process that creates a node_modules -> _modules symlink at runtime before spawning the backend (NODE_PATH does not work for ESM module resolution) commit 703d43bc9ced4773d6247302bd1a9bdc8b8f37a6 Author: Youpele Michael <[email protected]> Date: Mon Apr 13 01:54:25 2026 +0200 Fixed packaged desktop backend startup by staging server runtime The installed desktop app was only copying apps/server/dist into Resources/server, but dist/bin.mjs still imported runtime packages such as effect and @effect/platform-node. That left the spawned backend process without a resolvable server-local node_modules tree, causing ERR_MODULE_NOT_FOUND on startup and preventing the packaged app from connecting to its local WebSocket backend. Updated the desktop artifact pipeline to copy the full apps/server directory into extraResources, generate a standalone staged apps/server/package.json, and run bun install --production inside the staged server directory so Resources/server/dist/bin.mjs ships with matching production dependencies in installed builds. commit f6a8b2b3ca60acf6fa4d558e0da7be0562bf0b97 Author: Youpele Michael <[email protected]> Date: Mon Apr 13 01:14:01 2026 +0200 fixed packaged app server spawn: placed server dist outside asar via extraResources commit 8dee6558cd51e02d259084837f17b7183525d9d1 Author: Youpele Michael <[email protected]> Date: Mon Apr 13 00:39:07 2026 +0200 Fixed native addon asar packaging and improved server crash diagnostics commit cde60d1dbcd40b1852dea095db524aa1b42687d8 Author: Youpele Michael <[email protected]> Date: Mon Apr 13 00:05:38 2026 +0200 Removed finalize job from release workflow (no GitHub App configured) commit 1fc7bf536910d0ff8563f5153bf2991279607a82 Author: Youpele Michael <[email protected]> Date: Sun Apr 12 23:35:34 2026 +0200 Removed npm CLI publishing from release workflow (desktop-only app) commit 6861ff20c7d443d4475d445f6cd652c2f7cfe1f8 Author: Youpele Michael <[email protected]> Date: Sun Apr 12 23:19:41 2026 +0200 Fixed release workflow to publish GitHub Release even if npm fails commit 4c515eb9e2e41c807ffa2710530fd6a58a102690 Author: Youpele Michael <[email protected]> Date: Sun Apr 12 22:46:05 2026 +0200 Update release.yml commit f4298932ba32db555f14692ad277a3c2451034ac Author: Youpele Michael <[email protected]> Date: Sun Apr 12 20:42:07 2026 +0200 Build server CLI and check dist/bin.mjs Update release workflow to run the build from apps/server (bun run --cwd apps/server build --verbose) instead of filtering packages. Adjust the CLI publish script to assert the CLI artifact is dist/bin.mjs (was dist/index.mjs). These changes align the release job with the server app's build output and ensure the publish step validates the correct binary path. commit ac406d325293ea42a2e55fdd7a1ad0001bf4c5d1 Author: Youpele Michael <[email protected]> Date: Sun Apr 12 20:02:31 2026 +0200 Updated installer entrypoints to use stable bootstrap script URLs Replaced the user-facing desktop install commands in the README, download page, and release docs so they fetch install.sh and install.ps1 directly from the repository instead of GitHub release asset URLs that 404 before a stable release exists. This keeps GitHub Releases as the source of desktop binaries while making the bootstrap script entrypoint consistently reachable for macOS, Linux, and Windows users. commit 1f5467d6f6da0d2c3d5b5903c24e85a495bf49ff Author: Youpele Michael <[email protected]> Date: Sun Apr 12 19:38:20 2026 +0200 Updated: Removed browser tests from CI and documented local-only policy Removed the Playwright cache, browser runtime install, and browser test steps from the CI quality job so the pipeline only runs formatting, linting, typechecking, unit tests, and builds. Documented that browser tests are now local-only, updated the command guidance in docs/browser-tests.md, and clarified that both active and deferred browser test files are excluded from CI/CD. commit a98c8a416fd2034be3bccad579ba8f238ad62e94 Author: Youpele Michael <[email protected]> Date: Sun Apr 12 18:42:17 2026 +0200 Squashed commit of the following: commit 08243090054b1714aae46ac3873cf3c34c92f3cc Author: Youpele Michael <[email protected]> Date: Sun Apr 12 18:41:30 2026 +0200 Updated sidebar swipe delete interactions and project removal cleanup Added a shared sidebar swipe-reveal interaction for thread and project rows so destructive actions stay consistent across touch, mouse, and trackpad input. Updated project removal to use the in-app confirmation dialog, cascade thread deletion through orchestration, preserve app-only deletion messaging, and clean up local draft, selection, terminal, and navigation state when projects are removed. commit 9a1ff8e68fbe44216e1f344ec5888174bf0d5091 Author: Youpele Michael <[email protected]> Date: Sun Apr 12 14:36:40 2026 +0200 Squashed commit of the following: commit cd6f0fe1cdce573a5c08dd874c92495a5b0b4334 Author: Youpele Michael <[email protected]> Date: Sun Apr 12 14:14:34 2026 +0200 Added: shared Searchbar for picker and branch search Created a shared Searchbar so the provider model picker, branch selector, and command input can reuse one search header instead of maintaining separate implementations. This keeps the ProviderModelPicker treatment as the visual source of truth while still letting specific consumers hide the search icon when they need to preserve their intended layout.\n\nAlso repaired branch filtering so results update while typing again, aligned the branch placeholder styling and copy with the provider picker, and updated the browser test selectors to match. Added focus-visible states and data-slot hooks so the shared controls stay accessible and easier to target in follow-up review fixes. commit 271aeebd0dac3e4f5489bc17304bcf315134cc8f Author: Youpele Michael <[email protected]> Date: Sun Apr 12 13:33:28 2026 +0200 Fixed: sent OpenCode image attachments as file parts Image attachments were reaching Copilot but not OpenCode, so persisted attachments now flow through the server adapter and are serialized into promptAsync as provider file parts backed by file URLs. This passes attachmentsDir into the OpenCode session dependencies, resolves stored image attachments during sendTurn, and adds a focused regression test so this mismatch does not regress.\n\nIt also includes a small Effect cleanup in ProviderNativeThreadTitleGeneration to keep typecheck green. Verification was completed successfully with bun fmt, bun lint, and bun typecheck, and the user confirmed the fix is now working. commit 9d63ef517578e15c149266a993df31504c38032f Author: Youpele Michael <[email protected]> Date: Sun Apr 12 03:43:41 2026 +0200 Updated: refined git workspace controls and editor link handling Git controls now keep draft-thread branch state aligned with the active workspace and present clearer checkout semantics for local versus worktree flows. The same cleanup improved wrapped terminal links, markdown file URLs, editor branding, and SSR-safe theming so desktop and web affordances behave more predictably. commit b37b0296edc4dd9dab71e458d54864791fdbe9f3 Author: Youpele Michael <[email protected]> Date: Sun Apr 12 03:43:34 2026 +0200 Added: expanded composer skills, runtime controls, and timeline actions The composer now supports discovered skill triggers, selection-surround editing, and the new auto-accept-edits runtime option while preserving persisted draft state. This also moved changed-file expansion into thread UI state and exposed assistant copy actions so follow-up conversations stay easier to manage across turns. commit b1317846ea8648b3b362f5aa2e0ac07e3e77c86f Author: Youpele Michael <[email protected]> Date: Sun Apr 12 03:43:08 2026 +0200 Updated: retried websocket recovery and stabilized chat resize behavior Websocket recovery now retries snapshot and replay flows through shared transport-aware logic, and stalled reconnects restart from explicit coordinator rules instead of drifting into exhausted state. The same pass simplified chat footer sizing and browser coverage so resize-driven composer behavior stays predictable while transport reconnects recover. commit a9d34220e821e57f73ef9509f09ebf8be0896adb Author: Youpele Michael <[email protected]> Date: Sun Apr 12 03:42:52 2026 +0200 Added: wired a global command palette into app shortcuts Registered mod+k as a first-class keybinding, added command-palette state and UI, and routed root-level navigation through the new palette. This also tightened shortcut coverage and preserved contextual new-thread defaults when launching actions from anywhere in the app. commit f6eae3f3e49e7e617dc4e5bd0ed8b623f0cb4e1f Author: Youpele Michael <[email protected]> Date: Sun Apr 12 03:42:47 2026 +0200 Added: exposed provider discovery metadata and intermediate runtime mode Providers now publish discovered slash commands and Codex skills, while runtime mode handling distinguishes supervised, auto-accept-edits, and full-access behavior across Claude and Codex. The update also keeps provider snapshots and terminal env filtering aligned with the expanded server contract. commit 095d962690242904f3d596f0be25fa4c9f9f42a7 Author: Youpele Michael <[email protected]> Date: Sun Apr 12 03:42:41 2026 +0200 Updated: hardened git status refresh around missing worktrees Git status and branch lookups now treat deleted or invalid working directories as non-repository states instead of surfacing brittle command failures. Also refreshed local git status after turn completion and tightened GitHub PR decoding so orchestration and stacked actions stay in sync with real workspace state. commit a178a6017574eeecade34a253fb634080f65f9b8 Author: Youpele Michael <[email protected]> Date: Sun Apr 12 03:41:01 2026 +0200 Added: scanned desktop backend ports and image copy menu support Desktop startup now searches for an available loopback port starting from the stable default instead of reserving a random one. Also exposed Copy Image in the desktop context menu and covered both behaviors with focused tests. commit 8b147fe44506aa2b1beec310d7d7846ed27fb7d9 Author: Youpele Michael <[email protected]> Date: Sun Apr 12 03:35:13 2026 +0200 Fixed: restored branch picker selection for large branch lists The branch list request was succeeding, but the selector's virtualized combobox path was not rendering large result sets correctly and item activation still depended on local click handlers instead of the combobox selection flow. Removed the broken virtualized rendering path, routed checkout/create actions through Combobox onValueChange, and added a focused browser regression test covering large branch lists and successful checkout selection. Validated with bun fmt, bun lint, bun typecheck, bun run --cwd apps/web vitest run src/components/git/BranchToolbar.logic.test.ts, and bun run --cwd apps/web test:browser -- --run src/components/git/BranchToolbarBranchSelector.browser.tsx. commit 1201750c9ec905e1d8020a0fde13c7540473e1c3 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 21:38:03 2026 +0200 Deferred flaky ProviderModelPicker browser test and documented convention Renamed ProviderModelPicker.browser.tsx to ProviderModelPicker.deferred-browser.tsx so it falls outside the Vitest include glob (src/components/**/*.browser.tsx) and no longer blocks CI in headless Chromium. Added docs/browser-tests.md documenting the deferred-browser naming convention, the reason for the rename, and instructions for re-enabling the test once the root cause of the intermittent failure is resolved. commit c9eb06abd55d83a13e6b68f789af238a2dbf0bd9 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 20:50:19 2026 +0200 Changed default home dir from .t3 to .bigCode Switch the default application/state directory from ~/.t3 to ~/.bigCode across code, docs, and tests. Updated references include desktop BASE_DIR, server telemetry and os utilities, dev-runner default, web worktree tests, and documentation (scripts, keybindings, observability). Tests and examples were adjusted to expect ~/.bigCode where applicable. commit b5dc035104b18ee8205f0477303bdb1547513f3e Author: Youpele Michael <[email protected]> Date: Sat Apr 11 17:50:35 2026 +0200 Fixed brittle server tests and restored typed error propagation in assertValidCwd - cli-config.test.ts: corrected otlpServiceName from 't3-server' to 'bigcode-server' - GitHubCli.test.ts: fixed vi.mock path from '../../processRunner' to '../../utils/processRunner' so the mock actually intercepts the real import - codexAppServerManager.test.ts: replaced vi.spyOn on non-existent instance method with vi.mock('./codexVersionCheck') module mock; added missing 4th argument (undefined) to all sendRequest assertions to match the actual 4-arg call signature in turnOps() - ProviderCommandReactor.test.ts: wired workspaceRoot from createHarness input into project.create dispatch; passed workspaceRoot: baseDir in file-expansion test so buildPathReferenceBlock resolves correctly; changed thread.create title to 'New thread' so canReplaceThreadTitle returns true; added modelSelection to second thread-title test's turn.start dispatch so title generation is triggered - Manager.process.ts: removed Effect.orDie from assertValidCwd so TerminalCwdError propagates as a typed failure instead of a fiber defect; updated return type from Effect<void, never> to Effect<void, TerminalCwdError> - Manager.session.ts: imported TerminalCwdError and updated SessionApiContext.assertValidCwd signature to match the new typed return type commit febb1368f1cabb043901932bcd4291ed76f53279 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 17:19:34 2026 +0200 Fixed GitManager missing-directory handling and stale PR fixtures Unwrapped GitCommandError causes when detecting missing-directory status lookups so GitManager continues returning the explicit non-repo result after executor error wrapping changed. Also updated the GitManager tests to use a guaranteed-missing child path instead of deleting a scoped temp directory, and aligned the fork repository fixture with the current bigCode repository name. commit 8dfcccf76120e52d85a8bbcb2308eb0960634836 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 17:03:46 2026 +0200 Added missing GitManager invalidateStatus mock to server tests Updated the shared server router test harness to provide GitManager.invalidateStatus after websocket git RPC routing started refreshing git status through the manager. This keeps the seam tests aligned with the current GitManager contract and prevents UnimplementedError failures in CI when exercising git websocket methods. commit 42af91f1f61b99521778c9876bbdd4741110eb5f Author: Youpele Michael <[email protected]> Date: Sat Apr 11 16:54:46 2026 +0200 Update tests to reflect new provider options and fix context menu mock path commit 0a0fd47ffc1380877395f2f1fc6ba0d246b94950 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 16:54:41 2026 +0200 Show BigCode logo centered on empty state instead of text commit eacceb3174f65069400598e91c201643773d4115 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 16:38:59 2026 +0200 Updated CI to use GitHub-hosted Ubuntu runner Replaced the unavailable Blacksmith runner label with ubuntu-24.04 so the quality job can start reliably in this repository instead of waiting indefinitely for a matching runner. commit 7f051c82ebd365ce41d7036a80df16ad71205dc1 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 16:16:56 2026 +0200 Updated GitHub Actions release validation and quality gates Added release asset assembly on main so CI validates the final desktop release payload shape, and added the format check to tagged release preflight so public releases use the same quality gates as main. commit 827f319917627ca34a1e23ee3a88d83fa4b1a333 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 16:12:43 2026 +0200 Squashed commit of the following: commit 177da1839eb84b7419225d664fbde6d846927568 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 16:04:02 2026 +0200 Added GitHub-hosted desktop installers and release build automation Published install.sh and install.ps1 as GitHub release assets, updated CI to validate cross-platform desktop release builds on main, and documented the direct curl and PowerShell install flow. commit a56ceb5ae597d3a94e97f14b9a575f5e86fbe4f6 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 15:46:05 2026 +0200 Reorganized: Updated documentation structure and content Reorganized root-level markdown files and updated documentation: - Updated AGENTS.md: Added apps/desktop and apps/marketing to Package Roles section - Updated .plans/README.md: Expanded from 10 to 19 numbered plans, organized into Numbered Plans, Additional Plans, and Specs sections - Updated CONTRIBUTING.md: Clarified that feature requests are accepted via issues, but code contributions (PRs) are not actively accepted - Moved REMOTE.md and KEYBINDINGS.md from root to docs/ directory for better organization - Deleted TODO.md (minor task list better tracked elsewhere) commit 79f163d01ac78995bb15814295f0f0825a6ea511 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 15:02:40 2026 +0200 Updated: moved first-turn thread titles to server-owned provider-native generation Removed the client-side first-send title heuristic so draft threads keep their neutral placeholder until the server generates the real title. The first-turn orchestration flow now passes the turn's actual model selection into thread title generation instead of reading the global text-generation setting. Added native provider-specific title generation paths for Copilot and OpenCode while keeping existing git commit, PR, and branch generation fallback routing scoped to those operations. Tightened Copilot and OpenCode title extraction so JSON-like or fenced responses are unwrapped to the actual title text, and updated orchestration/browser tests to assert that the client no longer sends a synthetic thread.meta.update for first-send titles. commit e40449c906f1baa65d370c027f0b48bee730dbcb Author: Youpele Michael <[email protected]> Date: Sat Apr 11 04:50:36 2026 +0200 Updated: Simplified DiffPanel component by removing lazy loading Removed Suspense and lazy loading from the DiffPanel component to simplify the code and improve initial load consistency: - apps/web/src/routes/_chat.$threadId.tsx: - Replaced lazy() import with direct import - Removed Suspense wrapper and DiffLoadingFallback component - Renamed LazyDiffPanel to DeferredDiffPanel for clarity - Removed unused imports (Suspense, lazy, DiffPanelHeaderSkeleton, DiffPanelLoadingState, DiffPanelShell) - Fixed useEffect dependency array (removed unused threadId variable) The DiffPanel now loads synchronously when needed, eliminating the loading state flash and reducing component complexity. The deferred rendering is still controlled by the renderDiffContent flag to prevent unnecessary initialization. commit a55032040a558ace79a7d9b8a37f7ae4c2db76b6 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 04:50:30 2026 +0200 Updated: Changed diff.toggle keybinding and improved keyboard event capture handling Changed the diff.toggle command shortcut from mod+d to mod+shift+g across all keybinding configurations to avoid conflicts with other commands. Updated event listener registration to use capture phase ({ capture: true }) for more reliable keyboard shortcut handling: Files updated: - apps/server/src/keybindings/keybindings.ts: Changed diff.toggle from mod+d to mod+shift+g - apps/server/src/keybindings/keybindings.test.ts: Added assertion for new diff.toggle shortcut - apps/web/src/components/chat/view/ChatView.keybindings.logic.ts: Added capture: true to keydown handler - apps/web/src/components/sidebar/Sidebar.keyboardNav.logic.ts: Added capture: true to keydown/keyup handlers - apps/web/src/routes/_chat.tsx: Added capture: true to global keyboard shortcut handler - apps/web/src/models/keybindings/keybindings.models.test.ts: Updated all diff.toggle test assertions - packages/contracts/src/server/keybindings.test.ts: Updated test keybinding to use mod+shift+g The capture phase ensures keybinding handlers execute before bubbling-phase handlers, preventing shortcuts from being intercepted by child components. commit c920482aa5f569909a95815ad656412ad4ffa370 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 04:50:23 2026 +0200 Refactored: Split monolithic ChatView.browser.tsx into modular test files Replaced the single 2,948-line ChatView.browser.tsx test file with a structured ChatView.browser/ directory containing 12 focused modules. The split improves maintainability by separating concerns into logical groupings: - fixtures.ts: Pure data factories, snapshot builders, and viewport specifications - scenarioFixtures.ts: Specialized snapshot builders for complex test scenarios - dom.ts: DOM interaction helpers, keyboard shortcuts, and wait utilities - types.ts: Shared TypeScript interfaces and type definitions - context.tsx: Browser test context with MSW worker, RPC harness, and state management - mount.ts: Test mounting utilities and measurement helpers Test files (each under 500 lines): - timelineEstimator.integration-test.browser.tsx: Timeline virtualization height estimation tests - editorPicker.integration-test.browser.tsx: Editor/IDE picker integration tests - scriptsWorktree.integration-test.browser.tsx: Project scripts and worktree handling tests - composer.integration-test.browser.tsx: Composer interactions, terminal context, and send behavior - threading.integration-test.browser.tsx: Thread lifecycle, shortcuts, and sidebar navigation - layout.integration-test.browser.tsx: Footer layout and resize behavior tests - archivePlan.integration-test.browser.tsx: Archive actions and plan expansion tests Each test file now manages its own beforeAll/afterAll/beforeEach/afterEach lifecycle while sharing the extracted infrastructure modules. This follows the project's maintainability priority of avoiding duplicate logic and keeping files focused. commit c16499a92f4027e2ab4b3ae977905fe28fef05b8 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 02:15:35 2026 +0200 Added: surfaced discovered agents and expanded compact mentions for provider turns Added a discovery registry that scans provider-specific agent and skill definitions, publishes the catalog through server config updates, and exposes the new discovery types in shared contracts so the web app can autocomplete and render them. Updated the composer, mention parsing, and message timeline to support compact @agent::, @skill::, and workspace path references while keeping the stored user message text unchanged. Expanded those references on the server before sending a turn to providers so agent instructions, skill guidance, and referenced file contents are available as active context without mutating the persisted transcript. Added tests for provider input expansion, discovery-backed server state, mention logic, and message rendering, and included supporting refactors in terminal and git helpers needed to keep the new flow reliable. commit 923f6ae8c96d029914fcf95ef3b64aa03639b92d Author: Youpele Michael <[email protected]> Date: Fri Apr 10 23:17:00 2026 +0200 Extracted hardcoded T3 server branding into shared constants in @bigcode/contracts - Created APP_BASE_NAME, APP_SERVER_NAME, and APP_SERVER_SLUG constants in packages/contracts/src/constants/branding.constant.ts - Replaced all hardcoded 'T3 server' or 'T3' references across server CLI, web WebSocket UI, RPC protocol, and transport error modules with the new APP_SERVER_NAME and APP_SERVER_SLUG constants - Re-exported branding constants from @bigcode/contracts barrel and web branding config - Updated websocket.constant.ts JSDoc to reference APP_SERVER_NAME commit fbf3b553a98b210e77ce4c5c828de222466298d9 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 15:03:41 2026 +0200 Squashed commit of the following: commit 79f163d01ac78995bb15814295f0f0825a6ea511 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 15:02:40 2026 +0200 Updated: moved first-turn thread titles to server-owned provider-native generation Removed the client-side first-send title heuristic so draft threads keep their neutral placeholder until the server generates the real title. The first-turn orchestration flow now passes the turn's actual model selection into thread title generation instead of reading the global text-generation setting. Added native provider-specific title generation paths for Copilot and OpenCode while keeping existing git commit, PR, and branch generation fallback routing scoped to those operations. Tightened Copilot and OpenCode title extraction so JSON-like or fenced responses are unwrapped to the actual title text, and updated orchestration/browser tests to assert that the client no longer sends a synthetic thread.meta.update for first-send titles. commit e40449c906f1baa65d370c027f0b48bee730dbcb Author: Youpele Michael <[email protected]> Date: Sat Apr 11 04:50:36 2026 +0200 Updated: Simplified DiffPanel component by removing lazy loading Removed Suspense and lazy loading from the DiffPanel component to simplify the code and improve initial load consistency: - apps/web/src/routes/_chat.$threadId.tsx: - Replaced lazy() import with direct import - Removed Suspense wrapper and DiffLoadingFallback component - Renamed LazyDiffPanel to DeferredDiffPanel for clarity - Removed unused imports (Suspense, lazy, DiffPanelHeaderSkeleton, DiffPanelLoadingState, DiffPanelShell) - Fixed useEffect dependency array (removed unused threadId variable) The DiffPanel now loads synchronously when needed, eliminating the loading state flash and reducing component complexity. The deferred rendering is still controlled by the renderDiffContent flag to prevent unnecessary initialization. commit a55032040a558ace79a7d9b8a37f7ae4c2db76b6 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 04:50:30 2026 +0200 Updated: Changed diff.toggle keybinding and improved keyboard event capture handling Changed the diff.toggle command shortcut from mod+d to mod+shift+g across all keybinding configurations to avoid conflicts with other commands. Updated event listener registration to use capture phase ({ capture: true }) for more reliable keyboard shortcut handling: Files updated: - apps/server/src/keybindings/keybindings.ts: Changed diff.toggle from mod+d to mod+shift+g - apps/server/src/keybindings/keybindings.test.ts: Added assertion for new diff.toggle shortcut - apps/web/src/components/chat/view/ChatView.keybindings.logic.ts: Added capture: true to keydown handler - apps/web/src/components/sidebar/Sidebar.keyboardNav.logic.ts: Added capture: true to keydown/keyup handlers - apps/web/src/routes/_chat.tsx: Added capture: true to global keyboard shortcut handler - apps/web/src/models/keybindings/keybindings.models.test.ts: Updated all diff.toggle test assertions - packages/contracts/src/server/keybindings.test.ts: Updated test keybinding to use mod+shift+g The capture phase ensures keybinding handlers execute before bubbling-phase handlers, preventing shortcuts from being intercepted by child components. commit c920482aa5f569909a95815ad656412ad4ffa370 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 04:50:23 2026 +0200 Refactored: Split monolithic ChatView.browser.tsx into modular test files Replaced the single 2,948-line ChatView.browser.tsx test file with a structured ChatView.browser/ directory containing 12 focused modules. The split improves maintainability by separating concerns into logical groupings: - fixtures.ts: Pure data factories, snapshot builders, and viewport specifications - scenarioFixtures.ts: Specialized snapshot builders for complex test scenarios - dom.ts: DOM interaction helpers, keyboard shortcuts, and wait utilities - types.ts: Shared TypeScript interfaces and type definitions - context.tsx: Browser test context with MSW worker, RPC harness, and state management - mount.ts: Test mounting utilities and measurement helpers Test files (each under 500 lines): - timelineEstimator.integration-test.browser.tsx: Timeline virtualization height estimation tests - editorPicker.integration-test.browser.tsx: Editor/IDE picker integration tests - scriptsWorktree.integration-test.browser.tsx: Project scripts and worktree handling tests - composer.integration-test.browser.tsx: Composer interactions, terminal context, and send behavior - threading.integration-test.browser.tsx: Thread lifecycle, shortcuts, and sidebar navigation - layout.integration-test.browser.tsx: Footer layout and resize behavior tests - archivePlan.integration-test.browser.tsx: Archive actions and plan expansion tests Each test file now manages its own beforeAll/afterAll/beforeEach/afterEach lifecycle while sharing the extracted infrastructure modules. This follows the project's maintainability priority of avoiding duplicate logic and keeping files focused. commit c16499a92f4027e2ab4b3ae977905fe28fef05b8 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 02:15:35 2026 +0200 Added: surfaced discovered agents and expanded compact mentions for provider turns Added a discovery registry that scans provider-specific agent and skill definitions, publishes the catalog through server config updates, and exposes the new discovery types in shared contracts so the web app can autocomplete and render them. Updated the composer, mention parsing, and message timeline to support compact @agent::, @skill::, and workspace path references while keeping the stored user message text unchanged. Expanded those references on the server before sending a turn to providers so agent instructions, skill guidance, and referenced file contents are available as active context without mutating the persisted transcript. Added tests for provider input expansion, discovery-backed server state, mention logic, and message rendering, and included supporting refactors in terminal and git helpers needed to keep the new flow reliable. commit 923f6ae8c96d029914fcf95ef3b64aa03639b92d Author: Youpele Michael <[email protected]> Date: Fri Apr 10 23:17:00 2026 +0200 Extracted hardcoded T3 server branding into shared constants in @bigcode/contracts - Created APP_BASE_NAME, APP_SERVER_NAME, and APP_SERVER_SLUG constants in packages/contracts/src/constants/branding.constant.ts - Replaced all hardcoded 'T3 server' or 'T3' references across server CLI, web WebSocket UI, RPC protocol, and transport error modules with the new APP_SERVER_NAME and APP_SERVER_SLUG constants - Re-exported branding constants from @bigcode/contracts barrel and web branding config - Updated websocket.constant.ts JSDoc to reference APP_SERVER_NAME commit 377ef39db1bc3b9bf1c32b20ada94a37949d674e Author: Youpele Michael <[email protected]> Date: Sat Apr 11 03:13:57 2026 +0200 Squashed commit of the following: commit c16499a92f4027e2ab4b3ae977905fe28fef05b8 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 02:15:35 2026 +0200 Added: surfaced discovered agents and expanded compact mentions for provider turns Added a discovery registry that scans provider-specific agent and skill definitions, publishes the catalog through server config updates, and exposes the new discovery types in shared contracts so the web app can autocomplete and render them. Updated the composer, mention parsing, and message timeline to support compact @agent::, @skill::, and workspace path references while keeping the stored user message text unchanged. Expanded those references on the server before sending a turn to providers so agent instructions, skill guidance, and referenced file contents are available as active context without mutating the persisted transcript. Added tests for provider input expansion, discovery-backed server state, mention logic, and message rendering, and included supporting refactors in terminal and git helpers needed to keep the new flow reliable. commit 923f6ae8c96d029914fcf95ef3b64aa03639b92d Author: Youpele Michael <[email protected]> Date: Fri Apr 10 23:17:00 2026 +0200 Extracted hardcoded T3 server branding into shared constants in @bigcode/contracts - Created APP_BASE_NAME, APP_SERVER_NAME, and APP_SERVER_SLUG constants in packages/contracts/src/constants/branding.constant.ts - Replaced all hardcoded 'T3 server' or 'T3' references across server CLI, web WebSocket UI, RPC protocol, and transport error modules with the new APP_SERVER_NAME and APP_SERVER_SLUG constants - Re-exported branding constants from @bigcode/contracts barrel and web branding config - Updated websocket.constant.ts JSDoc to reference APP_SERVER_NAME commit 02b7a73625c9ccebc6b878325be62574c863af97 Merge: c3e6da60 88a6683d Author: youpele52 <[email protected]> Date: Fri Apr 10 01:13:23 2026 +0200 Added bundled Meslo Nerd Font with terminal appearance settings Added bundled Meslo Nerd Font with terminal appearance settings commit 69760eeed4c219437f8e4492dc53a50ee9c87012 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 21:52:30 2026 +0200 Squashed commit of the following: commit 1201750c9ec905e1d8020a0fde13c7540473e1c3 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 21:38:03 2026 +0200 Deferred flaky ProviderModelPicker browser test and documented convention Renamed ProviderModelPicker.browser.tsx to ProviderModelPicker.deferred-browser.tsx so it falls outside the Vitest include glob (src/components/**/*.browser.tsx) and no longer blocks CI in headless Chromium. Added docs/browser-tests.md documenting the deferred-browser naming convention, the reason for the rename, and instructions for re-enabling the test once the root cause of the intermittent failure is resolved. commit c9eb06abd55d83a13e6b68f789af238a2dbf0bd9 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 20:50:19 2026 +0200 Changed default home dir from .t3 to .bigCode Switch the default application/state directory from ~/.t3 to ~/.bigCode across code, docs, and tests. Updated references include desktop BASE_DIR, server telemetry and os utilities, dev-runner default, web worktree tests, and documentation (scripts, keybindings, observability). Tests and examples were adjusted to expect ~/.bigCode where applicable. commit b5dc035104b18ee8205f0477303bdb1547513f3e Author: Youpele Michael <[email protected]> Date: Sat Apr 11 17:50:35 2026 +0200 Fixed brittle server tests and restored typed error propagation in assertValidCwd - cli-config.test.ts: corrected otlpServiceName from 't3-server' to 'bigcode-server' - GitHubCli.test.ts: fixed vi.mock path from '../../processRunner' to '../../utils/processRunner' so the mock actually intercepts the real import - codexAppServerManager.test.ts: replaced vi.spyOn on non-existent instance method with vi.mock('./codexVersionCheck') module mock; added missing 4th argument (undefined) to all sendRequest assertions to match the actual 4-arg call signature in turnOps() - ProviderCommandReactor.test.ts: wired workspaceRoot from createHarness input into project.create dispatch; passed workspaceRoot: baseDir in file-expansion test so buildPathReferenceBlock resolves correctly; changed thread.create title to 'New thread' so canReplaceThreadTitle returns true; added modelSelection to second thread-title test's turn.start dispatch so title generation is triggered - Manager.process.ts: removed Effect.orDie from assertValidCwd so TerminalCwdError propagates as a typed failure instead of a fiber defect; updated return type from Effect<void, never> to Effect<void, TerminalCwdError> - Manager.session.ts: imported TerminalCwdError and updated SessionApiContext.assertValidCwd signature to match the new typed return type commit febb1368f1cabb043901932bcd4291ed76f53279 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 17:19:34 2026 +0200 Fixed GitManager missing-directory handling and stale PR fixtures Unwrapped GitCommandError causes when detecting missing-directory status lookups so GitManager continues returning the explicit non-repo result after executor error wrapping changed. Also updated the GitManager tests to use a guaranteed-missing child path instead of deleting a scoped temp directory, and aligned the fork repository fixture with the current bigCode repository name. commit 8dfcccf76120e52d85a8bbcb2308eb0960634836 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 17:03:46 2026 +0200 Added missing GitManager invalidateStatus mock to server tests Updated the shared server router test harness to provide GitManager.invalidateStatus after websocket git RPC routing started refreshing git status through the manager. This keeps the seam tests aligned with the current GitManager contract and prevents UnimplementedError failures in CI when exercising git websocket methods. commit 42af91f1f61b99521778c9876bbdd4741110eb5f Author: Youpele Michael <[email protected]> Date: Sat Apr 11 16:54:46 2026 +0200 Update tests to reflect new provider options and fix context menu mock path commit 0a0fd47ffc1380877395f2f1fc6ba0d246b94950 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 16:54:41 2026 +0200 Show BigCode logo centered on empty state instead of text commit eacceb3174f65069400598e91c201643773d4115 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 16:38:59 2026 +0200 Updated CI to use GitHub-hosted Ubuntu runner Replaced the unavailable Blacksmith runner label with ubuntu-24.04 so the quality job can start reliably in this repository instead of waiting indefinitely for a matching runner. commit 7f051c82ebd365ce41d7036a80df16ad71205dc1 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 16:16:56 2026 +0200 Updated GitHub Actions release validation and quality gates Added release asset assembly on main so CI validates the final desktop release payload shape, and added the format check to tagged release preflight so public releases use the same quality gates as main. commit 827f319917627ca34a1e23ee3a88d83fa4b1a333 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 16:12:43 2026 +0200 Squashed commit of the following: commit 177da1839eb84b7419225d664fbde6d846927568 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 16:04:02 2026 +0200 Added GitHub-hosted desktop installers and release build automation Published install.sh and install.ps1 as GitHub release assets, updated CI to validate cross-platform desktop release builds on main, and documented the direct curl and PowerShell install flow. commit a56ceb5ae597d3a94e97f14b9a575f5e86fbe4f6 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 15:46:05 2026 +0200 Reorganized: Updated documentation structure and content Reorganized root-level markdown files and updated documentation: - Updated AGENTS.md: Added apps/desktop and apps/marketing to Package Roles section - Updated .plans/README.md: Expanded from 10 to 19 numbered plans, organized into Numbered Plans, Additional Plans, and Specs sections - Updated CONTRIBUTING.md: Clarified that feature requests are accepted via issues, but code contributions (PRs) are not actively accepted - Moved REMOTE.md and KEYBINDINGS.md from root to docs/ directory for better organization - Deleted TODO.md (minor task list better tracked elsewhere) commit 79f163d01ac78995bb15814295f0f0825a6ea511 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 15:02:40 2026 +0200 Updated: moved first-turn thread titles to server-owned provider-native generation Removed the client-side first-send title heuristic so draft threads keep their neutral placeholder until the server generates the real title. The first-turn orchestration flow now passes the turn's actual model selection into thread title generation instead of reading the global text-generation setting. Added native provider-specific title generation paths for Copilot and OpenCode while keeping existing git commit, PR, and branch generation fallback routing scoped to those operations. Tightened Copilot and OpenCode title extraction so JSON-like or fenced responses are unwrapped to the actual title text, and updated orchestration/browser tests to assert that the client no longer sends a synthetic thread.meta.update for first-send titles. commit e40449c906f1baa65d370c027f0b48bee730dbcb Author: Youpele Michael <[email protected]> Date: Sat Apr 11 04:50:36 2026 +0200 Updated: Simplified DiffPanel component by removing lazy loading Removed Suspense and lazy loading from the DiffPanel component to simplify the code and improve initial load consistency: - apps/web/src/routes/_chat.$threadId.tsx: - Replaced lazy() import with direct import - Removed Suspense wrapper and DiffLoadingFallback component - Renamed LazyDiffPanel to DeferredDiffPanel for clarity - Removed unused imports (Suspense, lazy, DiffPanelHeaderSkeleton, DiffPanelLoadingState, DiffPanelShell) - Fixed useEffect dependency array (removed unused threadId variable) The DiffPanel now loads synchronously when needed, eliminating the loading state flash and reducing component complexity. The deferred rendering is still controlled by the renderDiffContent flag to prevent unnecessary initialization. commit a55032040a558ace79a7d9b8a37f7ae4c2db76b6 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 04:50:30 2026 +0200 Updated: Changed diff.toggle keybinding and improved keyboard event capture handling Changed the diff.toggle command shortcut from mod+d to mod+shift+g across all keybinding configurations to avoid conflicts with other commands. Updated event listener registration to use capture phase ({ capture: true }) for more reliable keyboard shortcut handling: Files updated: - apps/server/src/keybindings/keybindings.ts: Changed diff.toggle from mod+d to mod+shift+g - apps/server/src/keybindings/keybindings.test.ts: Added assertion for new diff.toggle shortcut - apps/web/src/components/chat/view/ChatView.keybindings.logic.ts: Added capture: true to keydown handler - apps/web/src/components/sidebar/Sidebar.keyboardNav.logic.ts: Added capture: true to keydown/keyup handlers - apps/web/src/routes/_chat.tsx: Added capture: true to global keyboard shortcut handler - apps/web/src/models/keybindings/keybindings.models.test.ts: Updated all diff.toggle test assertions - packages/contracts/src/server/keybindings.test.ts: Updated test keybinding to use mod+shift+g The capture phase ensures keybinding handlers execute before bubbling-phase handlers, preventing shortcuts from being intercepted by child components. commit c920482aa5f569909a95815ad656412ad4ffa370 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 04:50:23 2026 +0200 Refactored: Split monolithic ChatView.browser.tsx into modular test files Replaced the single 2,948-line ChatView.browser.tsx test file with a structured ChatView.browser/ directory containing 12 focused modules. The split improves maintainability by separating concerns into logical groupings: - fixtures.ts: Pure data factories, snapshot builders, and viewport specifications - scenarioFixtures.ts: Specialized snapshot builders for complex test scenarios - dom.ts: DOM interaction helpers, keyboard shortcuts, and wait utilities - types.ts: Shared TypeScript interfaces and type definitions - context.tsx: Browser test context with MSW worker, RPC harness, and state management - mount.ts: Test mounting utilities and measurement helpers Test files (each under 500 lines): - timelineEstimator.integration-test.browser.tsx: Timeline virtualization height estimation tests - editorPicker.integration-test.browser.tsx: Editor/IDE picker integration tests - scriptsWorktree.integration-test.browser.tsx: Project scripts and worktree handling tests - composer.integration-test.browser.tsx: Composer interactions, terminal context, and send behavior - threading.integration-test.browser.tsx: Thread lifecycle, shortcuts, and sidebar navigation - layout.integration-test.browser.tsx: Footer layout and resize behavior tests - archivePlan.integration-test.browser.tsx: Archive actions and plan expansion tests Each test file now manages its own beforeAll/afterAll/beforeEach/afterEach lifecycle while sharing the extracted infrastructure modules. This follows the project's maintainability priority of avoiding duplicate logic and keeping files focused. commit c16499a92f4027e2ab4b3ae977905fe28fef05b8 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 02:15:35 2026 +0200 Added: surfaced discovered agents and expanded compact mentions for provider turns Added a discovery registry that scans provider-specific agent and skill definitions, publishes the catalog through server config updates, and exposes the new discovery types in shared contracts so the web app can autocomplete and render them. Updated the composer, mention parsing, and message timeline to support compact @agent::, @skill::, and workspace path references while keeping the stored user message text unchanged. Expanded those references on the server before sending a turn to providers so agent instructions, skill guidance, and referenced file contents are available as active context without mutating the persisted transcript. Added tests for provider input expansion, discovery-backed server state, mention logic, and message rendering, and included supporting refactors in terminal and git helpers needed to keep the new flow reliable. commit 923f6ae8c96d029914fcf95ef3b64aa03639b92d Author: Youpele Michael <[email protected]> Date: Fri Apr 10 23:17:00 2026 +0200 Extracted hardcoded T3 server branding into shared constants in @bigcode/contracts - Created APP_BASE_NAME, APP_SERVER_NAME, and APP_SERVER_SLUG constants in packages/contracts/src/constants/branding.constant.ts - Replaced all hardcoded 'T3 server' or 'T3' references across server CLI, web WebSocket UI, RPC protocol, and transport error modules with the new APP_SERVER_NAME and APP_SERVER_SLUG constants - Re-exported branding constants from @bigcode/contracts barrel and web branding config - Updated websocket.constant.ts JSDoc to reference APP_SERVER_NAME commit fbf3b553a98b210e77ce4c5c828de222466298d9 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 15:03:41 2026 +0200 Squashed commit of the following: commit 79f163d01ac78995bb15814295f0f0825a6ea511 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 15:02:40 2026 +0200 Updated: moved first-turn thread titles to server-owned provider-native generation Removed the client-side first-send title heuristic so draft threads keep their neutral placeholder until the server generates the real title. The first-turn orchestration flow now passes the turn's actual model selection into thread title generation instead of reading the global text-generation setting. Added native provider-specific title generation paths for Copilot and OpenCode while keeping existing git commit, PR, and branch generation fallback routing scoped to those operations. Tightened Copilot and OpenCode title extraction so JSON-like or fenced responses are unwrapped to the actual title text, and updated orchestration/browser tests to assert that the client no longer sends a synthetic thread.meta.update for first-send titles. commit e40449c906f1baa65d370c027f0b48bee730dbcb Author: Youpele Michael <[email protected]> Date: Sat Apr 11 04:50:36 2026 +0200 Updated: Simplified DiffPanel component by removing lazy loading Removed Suspense and lazy loading from the DiffPanel component to simplify the code and improve initial load consistency: - apps/web/src/routes/_chat.$threadId.tsx: - Replaced lazy() import with direct import - Removed Suspense wrapper and DiffLoadingFallback component - Renamed LazyDiffPanel to DeferredDiffPanel for clarity - Removed unused imports (Suspense, lazy, DiffPanelHeaderSkeleton, DiffPanelLoadingState, DiffPanelShell) - Fixed useEffect dependency array (removed unused threadId variable) The DiffPanel now loads synchronously when needed, eliminating the loading state flash and reducing component complexity. The deferred rendering is still controlled by the renderDiffContent flag to prevent unnecessary initialization. commit a55032040a558ace79a7d9b8a37f7ae4c2db76b6 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 04:50:30 2026 +0200 Updated: Changed diff.toggle keybinding and improved keyboard event capture handling Changed the diff.toggle command shortcut from mod+d to mod+shift+g across all keybinding configurations to avoid conflicts with other commands. Updated event listener registration to use capture phase ({ capture: true }) for more reliable keyboard shortcut handling: Files updated: - apps/server/src/keybindings/keybindings.ts: Changed diff.toggle from mod+d to mod+shift+g - apps/server/src/keybindings/keybindings.test.ts: Added assertion for new diff.toggle shortcut - apps/web/src/components/chat/view/ChatView.keybindings.logic.ts: Added capture: true to keydown handler - apps/web/src/components/sidebar/Sidebar.keyboardNav.logic.ts: Added capture: true to keydown/keyup handlers - apps/web/src/routes/_chat.tsx: Added capture: true to global keyboard shortcut handler - apps/web/src/models/keybindings/keybindings.models.test.ts: Updated all diff.toggle test assertions - packages/contracts/src/server/keybindings.test.ts: Updated test keybinding to use mod+shift+g The capture phase ensures keybinding handlers execute before bubbling-phase handlers, preventing shortcuts from being intercepted by child components. commit c920482aa5f569909a95815ad656412ad4ffa370 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 04:50:23 2026 +0200 Refactored: Split monolithic ChatView.browser.tsx into modular test files Replaced the single 2,948-line ChatView.browser.tsx test file with a structured ChatView.browser/ directory containing 12 focused modules. The split improves maintainability by separating concerns into logical groupings: - fixtures.ts: Pure data factories, snapshot builders, and viewport specifications - scenarioFixtures.ts: Specialized snapshot builders for complex test scenarios - dom.ts: DOM interaction helpers, keyboard shortcuts, and wait utilities - types.ts: Shared TypeScript interfaces and type definitions - context.tsx: Browser test context with MSW worker, RPC harness, and state management - mount.ts: Test mounting utilities and measurement helpers Test files (each under 500 lines): - timelineEstimator.integration-test.browser.tsx: Timeline virtualization height estimation tests - editorPicker.integration-test.browser.tsx: Editor/IDE picker integration tests - scriptsWorktree.integration-test.browser.tsx: Project scripts and worktree handling tests - composer.integration-test.browser.tsx: Composer interactions, terminal context, and send behavior - threading.integration-test.browser.tsx: Thread lifecycle, shortcuts, and sidebar navigation - layout.integration-test.browser.tsx: Footer layout and resize behavior tests - archivePlan.integration-test.browser.tsx: Archive actions and plan expansion tests Each test file now manages its own beforeAll/afterAll/beforeEach/afterEach lifecycle while sharing the extracted infrastructure modules. This follows the project's maintainability priority of avoiding duplicate logic and keeping files focused. commit c16499a92f4027e2ab4b3ae977905fe28fef05b8 Author: Youpele Michael <[email protected]> Date: Sat Apr 11 02:15:35 2026 +0200 Added: surfaced discovered agents and expanded compact mentions for provider turns …

What Changed
Aligned the Claude token usage normalization with the same shared semantics used by the Codex adapter.
Both adapters now expose the context window fields with the same meaning:
usedTokens - the current in-window token usage
totalProcessedTokens - the accumulated total processed across requests when it is larger than usedTokens
maxTokens - the reported model context window
On the Claude side, this change makes sure accumulated result totals are not surfaced as current context usage. Instead, the current usage is bounded to the reported context window and the larger accumulated total is preserved in totalProcessedTokens.
Why
The context window UI depends on consistent normalized token usage across providers.
Codex already separates current usage from accumulated processed totals. Claude could previously report accumulated totals as current usage, which made the shared context window UI inconsistent and misleading.
This change aligns the Claude adapter with Codex semantics so the same UI can be used for both providers.
This does not solve the remaining gaps around compaction details or compact_boundary behavior. That still needs follow-up investigation in a separate PR.
UI Changes
Checklist
Note
Fix token usage metrics to clamp
usedTokensto the Claude context windownormalizeClaudeTokenUsagein ClaudeAdapter.ts now clampsusedTokensto the model's context window, while preservingtotalProcessedTokenswhen it exceeds the clamped value.task_progresssnapshot, the final turn completion keepsusedTokensfrom the earlier observed value and only updatestotalProcessedTokensif the accumulated total is larger.maxClaudeContextWindowFromModelUsageis refactored to use typedModelUsagerecords from@anthropic-ai/claude-agent-sdk, removing redundant finite/positive guards.thread.token-usage.updatedevents will now reportusedTokenscapped atmaxTokens(context window) rather than raw totals that could exceed it.📊 Macroscope summarized f0ad5d5. 1 file reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted
🗂️ Filtered Issues
Note
Medium Risk
Changes how Claude token usage is normalized and emitted, which can affect context-window UI and any downstream logic relying on
thread.token-usage.updatedsemantics. Scoped to usage accounting/typing with added tests to reduce regression risk.Overview
Aligns Claude token-usage semantics with the shared provider contract.
normalizeClaudeTokenUsagenow treatsusage.total_tokensas an accumulated processed total, clampsusedTokensto the reported modelcontextWindow, and surfaces oversize totals viatotalProcessedTokens.On turn completion, Claude now preserves the last in-window snapshot (from
task_progress) as the currentusedTokenswhile still updatingtotalProcessedTokensfrom the final result totals when larger. Adds regression tests covering oversize clamping and ensuring accumulated totals remain correct after progress snapshots.Reviewed by Cursor Bugbot for commit f0ad5d5. Bugbot is set up for automated code reviews on this repo. Configure here.