Commit Graph

92 Commits

Author SHA1 Message Date
can1357 df0bb6e31a feat: implemented provider wire codecs and optimized telemetry and parsing
- Added internal protobuf wire codecs, message builders, and protocol definitions for Cursor and Devin providers.
- Deferred loading of OTel SDK and OTLP exporters and added bounded caches to optimize startup and lookup performance.
- Added SQLite-backed parse caching for legacy extension source analysis and streaming file chunk parsing for changelogs.
- Added support for rendering context usage overflow above 100% in the status line component.
2026-08-20 07:54:06 +02:00
can1357 6740f146b0 style(tui): matched context window label color to compaction marker 2026-08-20 06:48:28 +02:00
can1357 a02da243e7 feat(agent): implemented preview titles and session compaction logic
- Added preview title support and fallback handling across shape previews and status line segments.
- Refined session list sizing and line height budgets in the session selector component.
- Extracted session compaction method helpers and improved speculative compaction logic.
- Prevented armed LLM speculation results from overriding local snapshot compaction execution.
2026-08-20 06:36:43 +02:00
can1357 43a557081f feat: introduced custom composer styles and runtime extension registration
- Added new field, rail, and rule composer styles with accent and surface color support.
- Introduced runtime extension registration for custom composer shapes and styles.
- Updated status line rendering and theme adapters to support dynamic composer styling and gaps.
- Added comprehensive unit tests for new composer shapes, extension loading, and rendering behaviors.
2026-08-20 06:11:57 +02:00
can1357 bd5764aad4 feat(coding-agent): integrated subscription status icons and advisor tracking
- Added theme icons and formatting for subscription status and advisor tracking across status lines and footers.
- Implemented `isAdvisorUsingSubscription` and `isUsingSubscription` methods to check active models against OAuth usage.
- Updated status line model segments to display the new advisor icon instead of text badges.
- Added comprehensive tests covering subscription and advisor costs across multiple font presets.
2026-08-20 05:51:53 +02:00
can1357 e8d7c0a493 feat: introduced pluggable composer layouts and status line gauge modes
- Introduced embedded mode and context gauge render options for the status line alongside boundary calculation helpers.
- Added pluggable composer styles with a style registry supporting box, claude, pi, and borderless layout rendering.
- Extracted speculation lead resolution into a dedicated shared module and added theme symbol definitions.
- Expanded test coverage for status line context gauge modes, composer shape previews, and editor style assertions.
2026-08-20 05:41:42 +02:00
can1357 3ef3b43b49 feat: introduced customizable composer shapes and status line rendering options
- Add support for customizable composer shapes and editor border styles including box, claude, pi, and borderless.
- Introduce a setup wizard scene and settings selector integration for choosing and previewing composer shapes.
- Enhance status line rendering to support standalone placement and context usage percentage shading.
- Add comprehensive unit tests covering composer shape previews, editor border styles, and status line rendering.
2026-08-20 05:06:17 +02:00
can1357 2f54e760c1 feat(coding-agent): added async compaction and in-place handoff
- Added compaction.asyncEnabled (Async Compaction, default on): when
  context enters the pre-threshold band [threshold - lead, threshold)
  with lead = clamp(threshold * 0.125, 8192, 32000), maintenance
  speculatively summarizes in the background off a branch snapshot
  (first configured LLM-backed method: remote, handoff, or soft) using
  a side session id isolated from the live turn. Crossing the threshold
  splices the armed result in instantly instead of blocking on a
  summarization round-trip. Armed results are invalidated by branch
  changes, reset boundaries, model switches that strand provider-native
  replay payloads, and context growth past keepRecentTokens (which
  re-speculates); extensions registering session_before_compact keep
  exact blocking semantics (speculation disabled).
- Reworked handoff to commit in place: /handoff and the auto handoff
  method now write the generated document as a regular compaction entry
  on the current session (summary = document + <files> tag, cut from
  prepareCompaction) instead of starting a new session. SessionHandoff
  shrank to a document generator; session_before_switch/session_switch
  no longer fire with reason "handoff"; mid-turn maintenance no longer
  suppresses the handoff preference; overflow recovery can apply an
  armed handoff result.
- Extracted the shared auto-compaction commit tail
  (#commitAutoCompactionResult / #commitCompactionEntry) used by the
  blocking production path, the armed speculative apply, manual
  compaction, and manual handoff.
- Status line pulses the auto-compact icon while a speculation runs and
  holds it in accent once a result is armed.
- Exported remotePreserveReusable from pi-agent-core/compaction for
  apply-time validation of speculative remote results.
2026-08-20 03:46:34 +02:00
can1357 6563b16424 fix(coding-agent): stat-poll git HEAD instead of fs.watch for branch display
- Bun's inotify-backed fs.watch permanently stops delivering events after
  observing git's atomic HEAD.lock -> HEAD rename in the watched directory
  (oven-sh/bun#24875), so the directory-watch fix for issue #8412 still froze
  the status-line branch on Linux after the first switch; CI caught it as a
  30s timeout in status-line-vcs-refresh.test.ts.
- Added git.head.watch: fs.watchFile stat-poll of the HEAD path (reftable dir
  for reftable repos) with a disposer; path-based polling survives inode swaps
  on every platform.
- Status line and footer now consume the helper; the footer previously bound
  fs.watch to the HEAD file inode and died after one switch on all platforms.
- Dropped the FSWatcher error-listener plumbing (StatWatcher has no error
  mode) and reworked the watcher lifecycle tests to the stat-poll contract;
  verified the atomic-rename regression test passes on Linux bun 1.3.14 in
  Docker where it previously timed out.
2026-08-13 20:20:49 +02:00
roboomp e62814b4b0 fix(coding-agent): watch git dir so branch display tracks switches
The status-line branch watcher bound fs.watch to the .git/HEAD file.
git updates HEAD via a lock file plus an atomic rename (HEAD.lock ->
HEAD), which unlinks the watched inode, so the watch fired for the
first branch switch and then died on the stale inode. The displayed
branch froze on the previous branch while later switches went unseen.

Watch the git directory instead of the HEAD file (and, for reftable
repos, the reftable dir as before) and filter directory events for the
HEAD entry. The directory inode is stable across renames, so the watch
survives every switch.

Fixes #8412
2026-08-13 07:05:32 +00:00
can1357 eafefaccf7 Merge PR #8337: fix(usage): use authoritative OpenCode Go quotas (@will-bogusz) 2026-08-13 01:14:53 +02:00
Will Bogusz 9eff02d36c fix(usage): use authoritative OpenCode Go quotas 2026-08-12 13:26:01 +02:00
Shawn Koh c948d7a289 fix(tui): preserve lazy border render contract
Amp-Thread-ID: https://ampcode.com/threads/T-019ff125-f53d-739b-8462-6027fe70f914
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 15:56:33 +08:00
can1357 64baa7c1bd chore(format): applied biome formatting and removed dead code from merged prs 2026-08-11 15:14:15 +02:00
can1357 24c348862f Merge PR #8197: fix(status-line): recognized kimi-code subscription windows in the usage segment (@tehfiend) 2026-08-11 15:06:16 +02:00
Bejay Cole e7f487381b fix(status-line): recognized kimi-code subscription windows in the usage segment
Kimi's usage provider built window ids from the raw duration/timeUnit ("300time_unit_minute") and left the aggregate quota on "default", so the status-line usage segment, which matches canonical "5h"/"7d" windows, never rendered for kimi-code sessions.

Derive window ids from the reported span instead (300 minutes -> "5h", 7 days -> "7d"), mirroring the minimax-code convention, and tag the aggregate quota as the weekly window. The payload carries only resetTime for the aggregate, but the observed reset horizon matches the plan's weekly cycle. The segment aggregator also falls back to the reported span (duration within a minute of 5h or 7d) when the id isn't canonical, so cache rows written by older builds still light up the 5h meter in mixed-version fleets.
2026-08-10 17:01:41 -06:00
dnth aa92c7e97c fix(ai): address Cursor usage review feedback
Gate status-line monthly rendering to Cursor, prefer personal dashboard
rails over legacy /auth/usage request fractions, fall back from unusable
overall buckets to plan, ignore disabled plan percent fields, and keep
on-demand when the included bucket is empty. Also add changelog PR/author
attribution for the external contribution.
2026-08-08 17:36:19 +08:00
dnth 69f790fa6e fix(ai): map Cursor plan rails to dashboard percents
Cursor Pro/Pro+ usage-summary still uses individualUsage.plan, but the
web dashboard percent is autoPercentUsed / apiPercentUsed — not
plan.used/limit cents. Prefer those rails for Cursor Models / Other
Models, keep overall+cents fallbacks, floor monthly status-line %, and
repaint after async usage fetch so mo N% does not stay blank.
2026-08-08 17:26:40 +08:00
dnth cc3835342e fix(ai): parse Cursor plan/onDemand usage and show monthly status-line
Cursor's /api/usage-summary now returns individualUsage.plan (and optional
onDemand) for Pro/Pro+/Ultra instead of the overall bucket that #7613
parsed. Fall back to plan when overall is absent, keep overall preferred
when both exist, and render monthly Cursor quotas in the status-line usage
segment.

Verified locally against a live Pro+ account and with focused unit tests.
2026-08-08 16:46:01 +08:00
Caelum d1ed93d8a2 fix(status-line): carry effective sessionAccent into SegmentContext and honor it for session_name
Address review feedback: the segment previously read the setting from ctx.session.settings, a second source of truth that could disagree with the component's effectiveSettings.sessionAccent and crashed lightweight test fixtures lacking a settings manager. Resolve the value once in #buildSegmentContext from the effective settings and pass it through SegmentContext.sessionAccent so the name segment and the gap-fill divider consume the same value. Add regression assertions for the enabled and disabled branches and a changelog entry.
2026-08-07 12:23:19 +08:00
can1357 73b834dcbc style: applied biome formatting to merged evaluator fixes 2026-08-02 21:01:20 +02:00
can1357 81babef622 fix(coding-agent): avoid redundant faint sequence in status cap 2026-08-02 20:53:22 +02:00
art-wiedzmin 6f6d298e6e fix(coding-agent): keep focused status caps bright 2026-08-02 14:55:13 +03:00
can1357 1b25ff01a2 style: apply biome formatting to merged changes 2026-07-30 02:01:03 +02:00
can1357 65ef740003 fix(coding-agent): preserved Codex quota identity 2026-07-30 01:43:54 +02:00
can1357 fcc8cce9d9 Merge remote-tracking branch 'refs/remotes/pr/6858' into prep/6858
# Conflicts:
#	packages/coding-agent/src/modes/components/status-line/component.ts
2026-07-30 01:41:54 +02:00
can1357 f62526f111 fix(coding-agent): preserve VCS cache refresh semantics
(cherry picked from commit 3f3e475109deb7b9e7690720827876fc982b5b8d)
2026-07-29 23:08:59 +02:00
robomp-bot 65707c7f4c fix(coding-agent): close VCS cache lifecycle gaps
(cherry picked from commit b88851334b07eb1da6743b51b542ea5d3222ccca)
2026-07-29 23:08:58 +02:00
robomp-bot c5b0348150 fix(coding-agent): harden async reftable resolution
(cherry picked from commit e451f1d6f3537d4b58dfe479a6daf8919d169397)
2026-07-29 23:08:58 +02:00
robomp-bot d966b3f8a0 perf(coding-agent): keep reftable branch resolution off the render path
(cherry picked from commit 5724c30ff66e2036ed03a2ce3514a9237a72a657)
2026-07-29 23:08:58 +02:00
joshrzemien 7a9f8da3f8 Fix Codex fireworks workspace account matching 2026-07-28 23:31:52 -04:00
joshrzemien 93b17a2f17 fix: bind Codex reset snapshots to accounts 2026-07-28 03:11:35 -04:00
joshrzemien 74debff579 fix: preserve unknown Codex fetch timestamps 2026-07-28 01:30:21 -04:00
joshrzemien a5ee376a70 fix: celebrate unscheduled weekly Codex resets 2026-07-28 01:12:44 -04:00
joshrzemien 06fd971f28 fix: address Codex reset fireworks review 2026-07-28 00:52:27 -04:00
joshrzemien 1ba1ddacab feat: add opt-in Codex reset fireworks 2026-07-28 00:33:53 -04:00
can1357 c64e7146e0 refactor(coding-agent): consolidated jujutsu logic into a centralized utility module
- Consolidated Jujutsu (jj) integration logic into a centralized utility module with working-copy and status handling.
- Removed deprecated jj-info helper modules and their corresponding test files.
- Updated status line component and associated tests to consume the new centralized jj utility API.
- Added comprehensive test coverage for working-copy label parsing, status summary mapping, and repository root resolution.
2026-07-23 20:47:42 +02:00
can1357 ed67dfa5e8 Merge PR #4450: feat(statusline): make git segment jj-aware (@mattwilkinsonn) 2026-07-23 17:30:32 +02:00
oldschoola 4a065e3d89 fix(status-line): aggregate vibe worker tok/s into the status-line badge
In /vibe mode the director is often idle while workers stream, so the
status-line tok/s badge showed a stale/zero rate even while parallel
workers were actively generating tokens. The badge now aggregates the
main session's live tok/s with every live vibe worker's tok/s, and
falls back to the main session's own cached rate when no workers are
streaming.

- Extract calculateTokensPerSecond to utils/token-rate.ts (neutral
  location) so vibe/runtime.ts can depend on it without the render
  layer depending on the heavy vibe/task graph.
- Add aggregateVibeWorkerTokensPerSecond to vibe/runtime.ts: sums
  each live worker's rate via the shared calculator, returns null
  when no workers are streaming so the main rate shines through.
- StatusLineComponent takes the aggregator via an injected
  setVibeWorkerTokenRateProvider callback (wired in interactive-mode)
  keeping the render layer off the vibe/task dependency graph.
- #getTokensPerSecond splits into #getMainSessionTokensPerSecond
  (preserves the sticky per-assistant-message cache) plus the
  worker-aggregation path, so the director-idle case no longer
  short-circuits to null.
2026-07-19 13:03:38 -07:00
Wolfgang Schoenberger 1d681d9eeb fix(coding-agent): show loop state in status line 2026-07-17 13:19:55 -07:00
can1357 2a6d551063 revert(status-line): restored single-row status bar with priority drop
- Reverted PR #5751 (issue #5749): continuation rows wrapped the editor
  top border onto extra lines, which is unacceptable for the input frame.
- EditorTopBorder is back to a single content/width pair; narrow widths
  drop right segments, shrink the path, then drop left segments.
2026-07-17 05:49:13 +02:00
roboomp 8ca790cb6f fix(status-line): wrapped overflow segments
Preserved configured segment priority by packing overflow into continuation rows.

Extended EditorTopBorder to render ordered rows inside the editor frame.

Fixes #5749
2026-07-16 20:19:54 +00:00
roboomp 34b4598918 fix(tui): rendered keyed hook statuses separately
Rendered each keyed extension status on an independently truncated line while preserving deterministic key ordering.

Added narrow-width regression coverage for multiple extension status keys.

Fixes #5617
2026-07-15 21:07:05 +00:00
can1357 7f9a2777f9 Merge PR #5170: fix(ai): scope Anthropic credential identity by organization, not just email (@chan1103) 2026-07-14 18:29:14 +02:00
can1357 da24614d5a feat: added scrollback rebuild controls and prewalk status-line visibility
- Added `tui.scrollbackRebuild` configuration with interactive startup/controller wiring to apply `setScrollbackRebuild`.
- Exposed prewalk session state in `SegmentContext` and rendered a dedicated prewalk segment/icon in the status line.
- Added divergence-aware TUI full-paint logic that enables scrollback erase-and-replay rebuilds for non-multiplexer divergence cases.
- Updated rendering and streaming tests to verify rebuild behavior (`3J`) and eliminate stale marker expectations under drift scenarios.
2026-07-14 00:39:34 +02:00
chan1103 a47c3c90ec fix(ai): org-decisive active matching on either side; org in status-line cache key and health results
Addresses the second review round (internal re-review + Codex on c38840482):

- Active-account matching (logout preselection, /usage in-use marker) is
  org-decisive when EITHER side carries an org: a legacy bare-email active
  row no longer flags org-scoped siblings via the shared email (reverse of
  the previous fix). Both-org-less keeps the email/account fallback, so
  providers without orgs are unaffected.
- Status-line usage context key includes orgId, so rotating between two
  same-email subscriptions invalidates the cached quota immediately
  instead of showing the previous org's numbers for the cache TTL.
- CredentialHealthResult carries orgId/orgName and auth-gateway check
  labels rows with the org, so a failing row names the subscription.
- getOAuthAccountIdentity preserves org-only identities; the login
  success message renders them.
- ACP /usage account-id fallback labels get the org suffix too.
- Regression tests for both matching directions (marker + logout).
2026-07-11 22:49:12 +09:00
can1357 1ab9c367ed feat(vibe): integrated vibe mode with interactive interface
- Implemented Vibe mode to enable worker session management and director-role context injection.
- Added a `/vibe` slash command and integrated status line UI to display mode activity.
- Configured restricted toolsets and guards to prevent concurrent conflicts with existing Goal or Plan modes.
- Provided system prompts and tool templates to support specialized agent communication and task orchestration.
2026-07-11 05:47:56 +02:00
Matt Wilkinson edbe4c4d97 fix(statusline): drop stale jj label after same-root invalidation
The throttled jj branch/status caches guarded in-flight results only by
root equality (`#jjRoot === root`). When a HEAD or bookmark move fires the
git watcher's `invalidate()` while a query for the *same* root is still in
flight, `#invalidateGitCaches()` resets `#jjRoot` but the next render
re-resolves it to the identical root string — so the root-only guard
accepts the pre-invalidation result, caches a superseded bookmark/status,
and advances the 5s throttle on it. The stale label then persists for a
full TTL after the move.

Replace the root-equality guard with a generation token bumped on every
cache reset (cwd switch in `#jjRootFor` and HEAD/bookmark move in
`#invalidateGitCaches`). Each query captures the generation at launch and,
on resolve, drops its result and refuses to advance the throttle if the
generation changed. This subsumes the old root check (a root change always
resets, bumping the generation) and additionally catches the same-root
case it structurally could not.

Regression test (revert-proven): a same-root invalidation mid-flight
renders the stale label without the fix, is dropped with it.

Co-Authored-By: seal <noreply@sealedsecurity.com>
2026-07-10 01:08:44 -04:00
Matt Wilkinson bcad7918c8 fix(statusline): keep jj caches coherent and gate jj status to jj-like HEAD
Reset the jj label/status caches in invalidateGitCaches so a watcher HEAD move refetches; key the async jj lookups by their captured root so a mid-flight repo switch can't land one repo's label/counts in another's cache; thread effectiveGitCwd through the jj lookups so an active child repo uses its own jj root. Gate jj status on a detached/absent git HEAD (mirroring the jj branch overlay) so a nested ordinary git checkout under a jj workspace keeps its own git status instead of the ancestor jj status. Adds cache-coherence + mid-flight-race regression tests.
2026-07-08 23:14:31 -04:00
Jeff Scott Ward a749d46ef6 fix: preserve status line path under overflow 2026-07-06 11:24:52 -04:00