Commit Graph

31 Commits

Author SHA1 Message Date
can1357 5b3275c7ae feat(coding-agent): introduced ordered provider priority lists for search and images
- Replaced single-provider preferences with ordered priority lists for web search and image generation.
- Added a `MultiSelectSubmenu` component supporting toggle and reordering interactions in settings.
- Implemented migration logic to convert legacy single-provider preferences into ordered priority lists.
- Updated setup wizard scenes, image generation fallback logic, and search provider chains to use priority lists.
2026-07-23 20:44:50 +02:00
can1357 7504d4c24d fix(coding-agent): kept setup wizard selection visible on short terminals
- Provider sign-in, theme, and web-search lists now shrink their visible row window to fit available height.
- Decorative chrome (sign-in hint, theme mock preview) yields to the list when space is tight.
- SelectList and OAuthSelector expose `setMaxVisible`/`setMaxHeight` so hosts can refit lists after construction.
2026-07-23 03:36:20 +02:00
can1357 51dbe05364 fix(setup): stopped re-running the wizard on existing installs
- Reverted the CURRENT_SETUP_VERSION bump (2 -> 1) introduced with the
  default-model setup step (#5982): the new scene now only runs for fresh
  installs instead of re-prompting every upgraded install once.
- Installs that already advanced to setupVersion 2 stay non-stale under
  the cold-launch gate, so no repeat prompt either way.
2026-07-20 23:45:02 +02:00
can1357 7e49a95d41 Merge PR #5982: fix(setup): add default model selection (@roboomp) 2026-07-20 22:50:05 +02:00
roboomp a7b75af19f fix(setup): honored project model-role storage
Setup now writes the chosen default to the project layer via setProjectModelRole when modelRoleStorage is project, instead of unconditionally persisting to the global config. Split the setup selection test into global and project scope cases.

Fixes #5979
2026-07-18 11:29:20 +00:00
roboomp e6f108f340 fix(setup): refreshed uncached models online
Changed the setup picker refresh to online-if-uncached so first-run discovery endpoints populate before model selection. Covered an initially empty registry that discovers the custom model during mount.

Fixes #5979
2026-07-18 11:24:12 +00:00
roboomp 0ec31c9c4e fix(setup): added default model selection
Added a setup step that persists the selected available model as the default role. Documented custom models.yml providers and manual default-role configuration.

Fixes #5979
2026-07-18 11:16:35 +00:00
roboomp c654abc980 fix(auth): scoped post-login model refresh and stripped cache credentials
Native /login and /logout (plus setup-wizard sign-in and RPC login)
refreshed model discovery with the default all-provider
online-if-uncached strategy, which reused a fresh authoritative cache row
and never re-ran fetchDynamicModels with the just-persisted credential,
so newly authenticated models stayed unavailable in-session and stale
endpoint data survived a relogin. Each auth-completion path now awaits a
provider-scoped refreshProvider(providerId, "online").

Also fixed writeModelCache serializing credential-bearing request headers
(Authorization, X-Api-Key, api-key, cookie, proxy-authorization) into the
plaintext models.db; they are now stripped before persistence and
re-derived on load from AuthStorage / provider config.

Fixes #5780
2026-07-17 03:03:25 +00:00
roboomp 721f6d4a08 fix(mcp): make full URL the primary OAuth copy target so SSH sessions work
Codex review flagged that advertising `launchUrl`
(http://localhost:<omp-port>/launch) as the visible `Copy URL:` breaks
SSH/WSL/headless users: their local browser resolves the URL against
the local machine (no OMP listening) and fails before ever hitting the
provider. On terminals without OSC 8 support, they lose the manual
`/login <redirect>` path entirely.

Every OAuth-facing surface now shows the full authorization URL as the
primary copy target and offers `launchUrl` as an additional "Local
shortcut (this machine only)" line for wide-terminal local users who
want the truncation-safe convenience:

- MCPAuthorizationLinkPrompt renders `Copy URL:` with the full URL and
  appends the local-shortcut row only when `launchUrl` differs. OSC 52
  clipboard staging in the MCP onAuth handler switches to the full URL
  (OSC 52 is a wire-level protocol — the terminal writes to the
  caller's LOCAL clipboard even when OMP is on a remote SSH box).
- LoginDialogComponent.showAuth, selector-controller onAuth,
  setup-wizard sign-in, and the auth-broker CLI mirror the pattern:
  full URL first, launchUrl as an optional local shortcut.
- Setup wizard uses `wrapTextWithAnsi`, not truncation, so the RFC
  7636 §4.3 downgrade bug that motivated launchUrl is unreachable
  through it; still surfaces launchUrl for wide-terminal convenience.

Regression tests in
`packages/coding-agent/test/modes/controllers/mcp-authorization-link.test.ts`
now assert:
- Full URL is the primary `Copy URL:` line so SSH sessions can complete.
- launchUrl still appears beneath as `Local shortcut (this machine only): …`
  when it differs from the full URL.
- No shortcut row when launchUrl is absent OR equals the full URL.
2026-07-03 08:57:55 +00:00
roboomp 97c1d08cce fix(mcp): surface a short launch URL and log Windows opener failures for OAuth
Two independent defects broke /mcp reauth against S256-only providers on
Windows boxes whose PATH no longer references System32:

1. openPath spawned bare rundll32 and swallowed the
   `Executable not found in $PATH` throw with a bare `catch {}`, so the MCP
   controller's outer try/catch was dead and the transcript unconditionally
   claimed "Opening browser automatically...".
2. TUI#prepareLine silently truncates any composed row wider than the
   viewport. MCPAuthorizationLinkPrompt rendered `Copy URL: <full URL>` as a
   single ~271-column line whose trailing parameter is
   code_challenge_method=S256. On the reporter's 270-col terminal the cut
   landed inside that parameter, dropping the method while keeping
   code_challenge — which RFC 7636 §4.3 treats as plain PKCE, which Linear
   correctly rejects with "The plain PKCE method is not allowed. Use S256
   instead."

OAuthCallbackFlow now hosts a `GET /launch` route on the same loopback
callback server it already runs; the route 302-redirects to the pending
authorization URL and is advertised as `OAuthAuthInfo.launchUrl` — a
~30-char copy target no viewport can meaningfully truncate. The MCP OAuth
fallback, /login, setup wizard, auth-broker CLI, and login-dialog all
prefer the launch URL for the visible copy target, keep the full URL in
the OSC 8 hyperlink for click-through, and the MCP flow additionally
stages the copy target on the clipboard via OSC 52 (same pattern the
setup wizard uses).

openPath now resolves rundll32.exe through %SystemRoot%\System32 (with a
C:\Windows fallback when SystemRoot is unset) and logs both synchronous
spawn throws and non-zero exits via the shared logger, so silent
misconfigurations show up in ~/.omp/logs/omp.*.log. The dead try/catch
around openPath in the MCP controller is removed.

Fixes #4418
2026-07-03 08:19:14 +00:00
Magicien 7da80bc325 fix(coding-agent): replay scrollback on theme changes 2026-06-30 13:06:53 +01:00
Wolfgang Schoenberger 3995e629ea refactor(coding-agent): reuse shared TUI mouse-routing helpers
Migrate fullscreen overlay selectors onto routeSgrMouseInput() and
routeSelectListMouse(), removing duplicated SGR parsing and SelectList
hit-test boilerplate. Behavior-preserving: wheel step sizes, footer/row
offset guards, and consumption semantics are unchanged.

Make the inline-picker wrappers (theme/thinking/queue-mode/show-images/
plugin) MouseRoutable, each subtracting their single top-border row before
delegating to SelectList.routeMouse(). Name previously magic coordinate
offsets (spacerRowsAfterTabs, contentColInset).
2026-06-24 20:09:48 -07:00
can1357 0919aeadea feat(coding-agent): add startup splash setting (#2884) 2026-06-18 02:48:29 +02:00
roboomp 507e0516d1 fix(auth): routed setup copy shortcut through prompt
Paste-code provider prompts now preserve the Alt+C authentication URL retry while their input owns TUI focus.\n\nFixes #2908
2026-06-17 23:30:14 +00:00
roboomp ba3b1529c1 fix(auth): copied setup sign-in urls
Provider setup now attempts clipboard/OSC 52 copy for authentication URLs and exposes Alt+C as a retry shortcut while the setup TUI owns selection.\n\nFixes #2908
2026-06-17 23:04:11 +00:00
Alexander Kirilin 8f6982eb83 feat(coding-agent): add startup splash setting 2026-06-17 10:28:07 -04:00
roboomp 27f0b922c7 fix(tui): preserved overlay-owned prompt focus
Overlay roots can now declare nested focus targets they own so visible overlays keep their active child focused while background prompt focus steals remain blocked.

Updated the setup wizard to register scene prompt focus targets and covered the nested prompt path in the overlay focus regression test.

Fixes #2789
2026-06-16 19:06:18 +00:00
can1357 7eca774cc7 feat(coding-agent): added mouse support to setup wizard scenes and controls
- Added SGR mouse routing to wizard scenes for hover, click, and wheel interactions.
- Added pointer-based tab selection and panel wheel scrolling in providers tabs.
- Added splash/outro left-click handling to start and complete the wizard flow.
- Added setup-wizard tests for mouse routing, splash click entry, and local coordinates.
2026-06-12 09:39:48 +02:00
handlecusion 8b6c1f97af fix: address setup command review 2026-06-10 08:26:00 +02:00
handlecusion f61cd7aad0 feat(coding-agent): add provider setup command 2026-06-10 08:26:00 +02:00
can1357 61a57c1d21 fix(coding-agent): stabilized streaming TUI rendering with readonly rows and memoized reuse
- Changed render methods to return component-owned `readonly string[]` rows.
- Added `RenderStablePrefix` row reuse to avoid repainting unchanged streaming content.
- Stabilized streaming gutters and spinner placement to reduce preview jitter and flicker.
- Finalized commit-safe transcript behavior for tool-call previews and added streaming edge-case tests.
2026-06-10 07:26:02 +02:00
can1357 31b6f0bf31 refactor(ai): consolidated provider config into single-source registry
- Derived descriptors, default-model map, env keys, login list, and refresh dispatch from one ProviderDefinition per provider.
- Disabled OpenAI Codex stream obfuscation and interrupted whitespace-only tool-call argument deltas.
- Derived auth-broker callback ports and paste-code login set from the registry.
2026-06-08 18:48:43 +02:00
can1357 1ebe2c7484 feat(packages/tui-and-shared-tooling-primitives): added TUI terminal support
- Made `Component.invalidate` optional in `packages/tui/src/tui.ts` and callsites.
- Added `iconOverride` support to status-line rendering in `status-line.ts`.
- Added `borderColor` and `framedBlock()` primitives in `output-block.ts` for framed output styling.
- Adjusted `renderOutputBlock()` to draw a continuous border when no header text is present.
- Added terminal checkpoint-reconciliation tests in `submit-checkpoint-reconcile.test.ts` for pinned-tail behavior.
2026-06-07 05:13:58 +02:00
can1357 e5e93ff762 feat(packages/coding-agent): enabled setup-version-gated startup flow
- Deferred setup wizard import until setup was forced or version stale.
- Dynamically loaded ACP, RPC, and print mode runners only when used.
- Added a marketplace auto-update scheduler with off-mode early exit and non-blocking errors.
- Added setup-version assertions to keep CURRENT_SETUP_VERSION aligned with scenes.
2026-06-06 22:58:33 +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
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
can1357 e7b7c3cc31 feat(coding-agent): added setup providers tabs for sign-in/web-search
- Added `SetupTab` abstractions and wired Sign-In/Web-Search tabs under the new providers onboarding scene.
- Added `providersSetupScene` and swapped `providerSetupScene` for `providers` in setup-wizard scene registration.
- Added `WebSearchTab` option loading, provider availability checks, and persisted selected search-provider preference.
- Changed sign-in flow handling to keep the scene active across providers and support cancellation during authentication.
- Changed glyph-mode picker initialization and rendering to preselect current preset and show live symbol previews.
- Updated setup wizard tests to use the `providers` scene id and cover the new web search tab path.
2026-05-31 00:29:48 +02:00
can1357 5f63165637 feat(setup-wizard): added interactive onboarding wizard on first launch
- Added setup wizard with provider login, glyph mode, and theme scenes shown once per setup version.
- Wired `omp setup` (no args) to trigger the wizard in a TTY; `--check`/`--json` still show help.
- Extracted `gradientEscape` and exported `PI_LOGO`/`ShineConfig` from welcome for shared use in splash/outro.
- Fixed race condition in `setSymbolPreset`/`setColorBlindMode` by tracking load request IDs.
2026-05-31 00:07:14 +02:00