Commit Graph

1246 Commits

Author SHA1 Message Date
basedcorp99 794a64aae1 fix(usage): address review — order email before project, add tests, nits
- BLOCKING: reorder resolveProviderCredentialIdentityKey so email
  identity takes priority over project — two users with different
  emails on the same GCP project no longer get merged/hard-deleted.

- Added #getUsageReportScopeProjectId helper so Gemini CLI reports
  (which set projectId on limit.scope but not metadata) still get
  dedup coverage. Both metadata and scope projectId paths checked.

- formatAggregateAmount now falls back to limits.length when no
  scope.accountId values are present, preserving pre-existing
  behaviour for providers that don't set accountId on limits.

- Added 9 contract tests for the antigravity usage merge logic:
  tier dedup, worst-fraction-wins, mixed-case collapsing,
  reset-time-from-other-entry, windowId separation, metadata,
  sort order, and null-on-no-project.

- Nits: label='Usage' (so formatLimitTitle renders 'Usage (Default)'
  not bare 'Default'), id uses params.provider instead of hardcoded
  string, tier field drops redundant ?? undefined.
2026-06-06 20:42:15 +02:00
basedcorp99 15c0dff28e fix(usage): fall back to limit.scope.projectId when metadata.projectId is absent
Gemini CLI provider stores projectId on limit.scope but not in report
metadata, so the metadata-only projectId fallback added earlier missed
that case. Now all three lookup sites (dedup identifiers, TUI account
label, ACP account label) also check limit.scope.projectId.
2026-06-06 20:42:15 +02:00
basedcorp99 c933d34398 fix(usage): antigravity /usage display — dedupe by tier, fix account count, add projectId identity
- Antigravity usage provider now deduplicates model quota entries by tier
  instead of emitting one bar per model (15+ redundant bars for one account).
  The upstream API groups quota by tier — models within the same tier share
  the same quota bucket, so per-model bars were misleading noise.

- Reports now carry credential email and accountId in metadata so the
  /usage display and deduplicator can show meaningful account identities
  instead of 'account 1'.

- formatAggregateAmount no longer uses limits.length as account count.
  Instead counts unique accountId values from limit scopes — a single
  account's N incomplete limits no longer display as 'N accts'.

- Usage report dedup now considers metadata.projectId for Google Cloud
  providers so duplicate credential rows with the same project merge.

- account labels in both TUI and ACP markdown paths now fall back to
  metadata.projectId before the generic 'account N' placeholder.
2026-06-06 20:42:15 +02:00
can1357 8a5b99a967 feat(coding-agent): enabled anonymous Perplexity fallback and updated web-search checks
- Added anonymous Perplexity authentication mode for unauthenticated web searches.
- Switched web-search setup checks to use `isExplicitlyAvailable` and removed key enforcement in doctor.
- Updated Perplexity OAuth flow to reuse auth handling for all non-key searches and anonymous responses.
- Updated CLI and provider option help text to mark the Perplexity key optional with fallback.
2026-06-06 19:42:16 +02:00
can1357 9aa10dd92b ux(coding-agent): condensed web_search result rendering
- Showed answer text in full in the TUI; kept the `omp q` compact cap.
- Rendered each source as a single title/domain/age line with the URL linked on the title.
- Collapsed the metadata block to one Provider line plus Usage.
- Rendered search errors as a framed panel matching the success layout.
2026-06-06 18:52:46 +02:00
can1357 d1fbb28edc fix(coding-agent): removed redundant tool-name line in custom render
- Fixed custom-rendered tools with `mergeCallAndResult` (e.g. `lsp`) emitting a redundant tool-name line above the framed result.
- Collapsed the leading blank line for self-delimiting framed boxes.
- Added gallery fidelity routing `lsp`/`task` through the custom-tool branch via a `customRendered` fixture flag.
- Added gallery harness tests guarding state coverage and the custom-branch fallback label.
2026-06-06 18:40:52 +02:00
can1357 40ed8852b5 feat(coding-agent): added app.display.reset bound to Ctrl+L
- Added `TUI.resetDisplay()` to force an immediate full-frame replay including native scrollback.
- Moved the persistent model selector default from Ctrl+L to Alt+M, preserving existing user remaps.
- Reserved Alt+M so extensions cannot shadow the model selector shortcut.
2026-06-06 17:19:57 +02:00
can1357 77d4b90d2c fix(coding-agent): fixed framed read output rendering by removing extra box padding
- Added `setPaddingY` to `Box` and used `setBoxPaddingForFramedBlock` when rendering framed outputs.
- Read tool results now skipped vertical padding in framed blocks, removing extra blank rows above and below the output.
- Added a regression test for `ToolExecutionComponent` that confirmed framed read content no longer renders extra blank lines.
2026-06-06 17:01:47 +02:00
can1357 6810c549a7 feat(coding-agent/modes): interleaved runnable commands into /copy tree
- Emitted per-command cmd:N targets after the assistant message that issued them.
- Carried commands from text-less messages to the next visible message.
- Replaced the single trailing "last command" leaf.
2026-06-06 15:45:59 +02:00
can1357 bcb48c4e43 fix(coding-agent/modes): enabled eager foreground rendering and suppressed duplicate error lines
- Updated EventController to keep foreground render mode active from agent_start through agent_end so live-region rebuild remains enabled during a turn.
- Pinned stop-reason assistant errors to the editor banner and suppressed the transcript's inline Error line while pinned, then restored it on the next agent_start.
- Added tests covering error-banner suppression/restoration and eager native scrollback rebuild ordering before loading animation.
2026-06-06 15:44:38 +02:00
can1357 c1f481c7de fix(coding-agent/modes): allowed bracket-prefixed partial input to be handled as raw text
- Updated rawTextInputFromPartialJson to stop excluding values that start with '[' from raw text fallback detection.
- Preserved existing exclusions for inputs starting with '{' and '"' in partial JSON detection.
2026-06-06 15:40:32 +02:00
can1357 ecd80120a3 feat(coding-agent): added framed tool rendering with capped streaming previews
- Wrapped tool call/result renderers with framed block markers for full-width display.
- Added preview-line caps via capPreviewLines to bound multiline outputs with truncation hints.
- Added code-cell tail rendering so streaming output shows capped tail slices with markers.
- Added setPaddingX in Box and applied framed-inline padding adjustments for tight layouts.
2026-06-06 15:19:06 +02:00
can1357 126f4e8dcf feat(coding-agent): replaced /copy subcommands with picker tree
- Added a fullscreen /copy tree of recent assistant messages with nested code blocks and a live preview pane.
- Removed the /copy last|code|all|cmd subcommands in favor of tree selection.
- Extracted copy-target assembly into a testable util.
2026-06-06 15:15:54 +02:00
can1357 6d99f2e740 feat(model-selector): disabled models below current context size
- Dimmed models whose context window is smaller than current usage.
- Skipped disabled entries during navigation and selection.
- Showed context-limit suffix and warning for unselectable models.
2026-06-06 15:10:14 +02:00
can1357 8b077cde58 perf(coding-agent): memoized native syntax highlighting
- Cached (lang, code) highlight output via LRU, invalidated on theme change.
- Stopped re-tokenizing unchanged code through Rust FFI every render frame.
- Prevented TUI freeze from animated tool blocks overrunning the frame budget.
2026-06-06 15:00:33 +02:00
can1357 2d0f62eb69 refactor(coding-agent): replaced list count indicators with ScrollView
- Wrapped selector and overlay list windows in ScrollView for proportional right-edge scrollbars.
- Dropped numeric position/count footers in favor of the scrollbar.
- Simplified SelectList status line to search hints only.
- Added ED3-risk autocomplete repaint test for POSIX terminals.
2026-06-06 14:20:41 +02:00
can1357 efd6703580 fix: fixed native scrollback behavior for append-only assistant streams
- Fixed assistant transcript blocks to expose append-only commit-safe boundaries.
- Updated TUI live-region commit and pinned-paint logic to clamp commit-safe ends.
- Fixed long streamed assistant replies to remain in native scrollback on overflow.
2026-06-06 00:43:16 +02:00
can1357 ca143a4e08 feat(coding-agent): pinned turn-ending provider errors above editor
- Added a persistent error banner so stream errors survive transcript scroll.
- Cleared the banner when the next turn starts.
- Skipped pinning for aborts and normal stops.
2026-06-06 00:23:07 +02:00
can1357 340ac31122 fix(coding-agent): appended queued image messages synchronously
- Removed async image-link materialization between user message_start and addMessageToChat.
- Fixed steering bubbles rendering below the tool output they were sent to steer.
- Materialized clickable image links via synchronous blob-store fallback instead.
2026-06-05 23:57:01 +02:00
can1357 388e6462c3 fix(coding-agent): fixed cold-launch scrollback and frozen abort labels
- Cleared native scrollback on `omp`/`omp -c` so the resumed transcript no longer stacks on the prior run's welcome screen.
- Tracked assistant block finalization so aborted streaming messages stay repaintable when status rows land beneath them on ED3-risk terminals.
2026-06-05 23:50:49 +02:00
can1357 da636e3f51 feat(coding-agent): enabled clickable image and path links across chat and tools
- Added image-reference rendering to make `[Image #N]` placeholders clickable in chat.
- Added MIME-aware image blob materialization with extensioned sidecar paths.
- Added clickable path, line, and URL hyperlinks for read, search, and fetch outputs.
- Hardened OSC8 hyperlink emission with URI validation and control-byte/idempotency checks.
2026-06-05 23:38:22 +02:00
can1357 70c94efabe fix(coding-agent): froze live region by block finalization state
- Replaced bottom-most-block liveness with a finalization check so the live region spans every still-mutating block.
- Kept unfinalized tools repaintable when out-of-band inserts append finalized blocks below them.
- Recomputed blocks as they cross out of the live region to seal their final content.
2026-06-05 23:34:05 +02:00
can1357 61f11a6ce0 fix(tui): blocked destructive scrollback replay on unknown terminal viewports
- Blocked checkpoint scrollback replay unless native viewport-at-bottom proof succeeded.
- Expanded ED3-risk terminal detection to include SSH, multiplexer, WT-like, and unknown profiles.
- Added sync-output defaults with PI_TUI_SYNC_OUTPUT and PI_FORCE_SYNC_OUTPUT overrides.
- Deferred transcript thawing until native scrollback refresh returned true.
- Adjusted non-escape parsing to emit one Unicode scalar and raised timeout to 75ms.
2026-06-05 17:47:47 +02:00
can1357 c130fde15e Merge remote-tracking branch 'origin/farm/b86bd90c/log-session-title-failures' 2026-06-05 11:44:54 +02:00
can1357 29c91250fc Merge remote-tracking branch 'origin/farm/d4f04d82/tree-not-list-sessions' 2026-06-05 11:44:08 +02:00
can1357 7f06ef86fa Merge remote-tracking branch 'origin/farm/a8a41944/login-url-cut-off-ellipsis' 2026-06-05 11:43:49 +02:00
can1357 1e3a8d5cdf fix(tui): pinned native scrollback to commit sealed live-region rows
- Added `NativeScrollbackLiveRegion` seam so components report the live suffix start.
- Stopped ED3-risk streaming from dropping sealed transcript rows above the live block.
- Appended newly sealed rows once while keeping the active tail deferred to checkpoint.
2026-06-05 11:29:18 +02:00
roboomp 2ef758f5e3 fix(coding-agent): kept setup login url row visible
Reserved the first wrapped plain-text login URL rows above the manual-code prompt, while rendering the complete wrapped URL again below the prompt for terminals without OSC 8 support.

Fixes #1919
2026-06-05 08:12:43 +00:00
roboomp b896007e75 fix(coding-agent): pinned setup login link above prompt
Hoisted an always-visible OSC8 'Browser login' row in the setup sign-in tab so wizard body clipping never hides both the clickable link and the focused manual-code prompt. The wrappable URL text still renders below for terminals without OSC 8 support.

Fixes #1919
2026-06-05 08:07:43 +00:00
roboomp 9333fccc03 fix(coding-agent): kept setup login prompts visible
Rendered manual-code prompts before wrapped OAuth status lines so wizard body clipping cannot hide the focused input behind a long login URL.

Fixes #1919
2026-06-05 08:00:16 +00:00
roboomp 510a2b8596 fix(coding-agent): preserved setup login urls
Wrapped setup sign-in OAuth status lines instead of truncating them, and added a full OSC8 login link so narrow terminals still expose the complete URL.

Fixes #1919
2026-06-05 07:54:37 +00:00
roboomp 01677a0c1f style: bun run fix 2026-06-05 05:58:04 +00:00
roboomp ccc3533c45 fix(tui): differentiate /tree empty-state for fresh sessions
The session-tree selector collapsed to "No entries found" whenever the
default filter rejected every entry. On a fresh session that is the
normal case: `sdk.ts` writes `model_change` + `thinking_level_change`
at startup so model + thinking state survive resumes, and the default
filter treats both as bookkeeping. `selector-controller.showTreeSelector`
guards on `tree.length === 0` so the selector still opens, and the user
sees an unexplained empty panel with `(0/0)` next to a "Recent sessions"
list that does contain data.

Split the empty-state branch into three shapes:
- `flatNodes.length === 0` → unchanged "No entries found".
- `searchQuery` non-empty → "No entries match search \"…\"" plus a
  Backspace hint, with the real total in `(0/N)`.
- otherwise → "N entries hidden by the current filter [mode]" plus
  "Press Alt+A to show all, Alt+D for default", with the real total in
  `(0/N)`.

So the fresh-session case now explains why the panel is empty and how
to widen it instead of reading as "/tree is broken".

Fixes #1909
2026-06-05 05:57:47 +00:00
can1357 4e54836f94 chore(tui): adopt #1895 streaming-scrollback-defer; drop live-region pin 2026-06-05 06:42:05 +02:00
can1357 7447086186 fix(tui): pinned live region to stop scrollback dup on ED3 streams
- Added NativeScrollbackLiveRegion seam reporting where a component's transient suffix begins.
- Pinned the live block and chrome below it out of native history during foreground streams on ED3-risk terminals.
- Consumed pending forced scrollback wipes while pinned to avoid yanking a scrolled-up reader (#1682).
2026-06-05 00:53:39 +02:00
roboomp 356db2b845 fix(coding-agent): surfaced title generation failures
Logged structured session-title generation skip and failure outcomes with session/model context, and prevented credential lookup errors from escaping into the caller's swallowed promise path.

Added regression coverage for missing and failing title credentials.

Fixes #1892
2026-06-04 22:27:23 +00:00
can1357 bfbb2464bb fix(coding-agent/modes): recomputed prior live block on live-to-frozen transition
- Tracked the previous live child in TranscriptContainer and forced a one-off recompute when a block leaves live status.
- Skipped snapshot reuse for that transitioning block so coalesced finalize-and-append frames seal transcript blocks at their final content.
- Added a regression test covering the stale-prefix freeze case on ED3-risk terminals and confirming the frozen block stays unchanged until thaw.
2026-06-04 18:46:16 +02:00
roboomp 18338e2088 fix(acp): refused dismissed plan approval
#requestAcpPlanApprovalChoice returned 'value !== REFINE_OPTION' which
treats any non-refine outcome — explicit dismissal, transport failure,
abort, or timeout — as approval. That meant closing the elicitation
dialog (or the request failing) granted the agent write access without
explicit user consent.

Tighten to 'value === APPROVE_OPTION' so only the explicit approve
selection passes the gate. Refine, dismissal, and every other outcome
fall through to refine semantics: the caller keeps plan mode active and
returns guidance text instead of renaming the plan and exiting.

Adds a regression test that drives a form-capable harness with a
cancelled elicitation and asserts the plan file is preserved, plan
mode/handler stay active, plan reference stays unset, and no mode-exit
notifications are emitted.
2026-06-04 18:30:22 +02:00
can1357 434b188a71 fix(tui): fixed streamed row reflow to stay committed in native scrollback
- Removed the AssistantMessageComponent completion flag and its stable-line counting helpers.
- Added a TUI regression test validating that reflowed streaming rows leaving the viewport are preserved in native scrollback and remain reachable.
- Removed changelog notes for obsolete stable-prefix scrollback APIs.
2026-06-04 17:51:15 +02:00
can1357 239ad877c4 Merge remote-tracking branch 'origin/farm/a70af80d/plan-accept-not-appearing-in-zed-using-a' 2026-06-04 17:42:26 +02:00
can1357 4a9ee14e33 feat(coding-agent): wrapped mid-turn steers in wire-only envelope
- Marked steering user messages and wrapped them pre-LLM so the model sees a `` envelope.
- Kept transcripts and persisted history with the user's original raw text.
- Restored `AssistantMessageComponent` stable-prefix completion API.
2026-06-04 17:41:56 +02:00
can1357 c8b4bf09c7 prompts: undo experiment, update system 2026-06-04 17:41:10 +02:00
roboomp 493f743958 fix(acp): synced config option after plan approval
ACP plan approval exited plan mode internally and emitted the current-mode
notification, but it did not push the matching mode config-option update.
Clients that cache or render the config selector could therefore keep
showing mode=plan after approval switched the session back to default.

The approval path now emits the same config_option_update used by other
mode transitions, and the regression test asserts that the approval-driven
exit updates both current_mode_update and the mode config option.
2026-06-04 15:37:38 +00:00
roboomp fdb6077b7b fix(acp): wired plan-mode standing resolve handler
ACP plan mode set the plan-mode state but never installed the standing
resolve handler that interactive mode wires in #enterPlanMode. The agent
in plan mode dutifully called resolve { action: 'apply', extra.title }
to submit its plan; ResolveTool.execute then consulted
peekQueueInvoker() ?? peekStandingResolveHandler(), found neither, and
threw 'No pending action to resolve. Nothing to apply or discard.' —
stranding the agent with no path out of plan mode in Zed (and any other
ACP client).

#applyModeChange now registers a standing handler when entering
mode: 'plan' and clears it when leaving. The handler:
 - validates the plan file exists at the configured '/data/workspaces/can1357__oh-my-pi__1869/.omp-session/2026-06-04T15-12-15-302Z_019e9331-31c6-7000-9bce-6be119505a1d/local' path,
 - normalizes the agent-supplied title to a safe filename stem,
 - asks the ACP client to confirm via unstable_createElicitation when
   the client advertises elicitation.form (auto-approves otherwise so
   the agent never gets stuck on a client without the surface),
 - renames the plan to '/data/workspaces/can1357__oh-my-pi__1869/.omp-session/2026-06-04T15-12-15-302Z_019e9331-31c6-7000-9bce-6be119505a1d/local/<title>.md,'
 - sets the plan reference path so the next turn injects the plan as
   context, then clears the standing handler + plan-mode state and
   emits current_mode_update so the client UI reflects the exit.

Refinement (user picks 'Refine plan') returns guidance text and leaves
plan mode active so the agent can iterate.

Fixes #1869
2026-06-04 15:30:27 +00:00
can1357 7124dbae93 fix(coding-agent): fixed session resume to reconcile modes and preserve model state
- Registered and triggered a session-switch reconciler during init and after switch.
- Rebuilt resume flow to restore plan/goal mode state and clear stale mode flags.
- Marked fallback and context-promotion model switches ephemeral and skipped them on restore.
- Added regression tests for temporary model ordering, fallback precedence, and mode cleanup.
2026-06-04 17:22:19 +02:00
can1357 7a7479f7e3 feat(coding-agent/modes): added arrow-key tab switching to dashboards
- Mapped left/right arrows to switch tabs in the extension dashboard.
- Updated agent and extension dashboard footers to show arrow controls.
- Reformatted HTTP transport assignment and reordered an import.
2026-06-04 16:37:50 +02:00
can1357 829b999dc1 feat(coding-agent/modes): added arrow-key based tab switching in the agent dashboard
- Mapped the right arrow key to advance tabs in the agent dashboard.
- Mapped the left arrow key to reverse tabs alongside shift+tab.
- Kept existing tab and shift+tab handling intact for backward-compatible navigation.
2026-06-04 16:32:17 +02:00
can1357 8709f7a7e6 fix(coding-agent): fixed terminal UIs to resize with rows and avoid extra OSC11 polling
- Adjusted session and dashboard renderers to derive heights from live terminal rows.
- Propagated terminal-row callbacks through picker/controller wiring and session selectors.
- Reworked list visibility and page navigation to honor row-based budgets and footer lines.
- Added DECRQM 2031 startup probing and stopped OSC11 polling once support was confirmed.
2026-06-04 16:29:37 +02:00
can1357 53c09417b4 feat(modes/components): added tokenized matching and selection navigation
- Added token-aware query matching so highlights mirror `HistoryStorage.search` tokenization.
- Added token highlighting, compact relative timestamps, and selected-row styling in results.
- Added PageUp/PageDown and Home/End selection shortcuts in `HistorySearchComponent`.
- Added selector matchers for `tui.select.pageUp` and `tui.select.pageDown`.
- Changed empty-result messaging to distinguish `No history yet` from `No matching history`.
- Added tests for page/home/end navigation and token-highlighting result rendering.
2026-06-04 16:02:34 +02:00
can1357 a3fec0b978 feat(modes/components): implemented agent creation multiline editor flow
- Replaced the single-line description Input with Editor in agent-dashboard.ts for multiline entry.
- Added Enter-newline and Ctrl+Enter submit handling to the create-agent editor flow.
- Updated agent-creation-architect.md guidance for concise single-sentence whenToUse output.
- Added integration tests for multiline editor rendering and Ctrl+Enter submission.
2026-06-04 16:02:34 +02:00