32 Commits

Author SHA1 Message Date
roboomp a6aa462a60 fix(tui): bounded WSL idle animation CPU
- Removed the Loader backpressure cap so slow ConPTY paints retain the documented proportional duty cycle.

- Made WSL terminal-title working state static to avoid a second periodic OSC write loop.

Fixes #8012
2026-08-08 13:17:01 +00:00
can1357 ccd3bb9565 chore: reformat 2026-07-30 04:25:32 +02:00
can1357 091f670ea0 style: apply biome formatting to merged changes 2026-07-30 01:28:07 +02:00
can1357 c60b6971db feat(coding-agent): used static colon separator for working terminal title on windows
- Keep terminal working titles static with a colon separator on Windows instead of scheduling animated spinner updates.
- Update terminal title builder and state machine to check the platform and bypass timer intervals on win32.
2026-07-27 15:04:04 +02:00
can1357 5e139d9515 feat(coding-agent): reduced terminal title update overhead with deduplication and FFI
- Deduplicate terminal title writes globally across all platforms.
- Adopt `SetConsoleTitleW` via `bun:ffi` for Windows terminal updates instead of OSC writes.
2026-07-27 14:35:06 +02:00
can1357 8490654df3 refactor(coding-agent): expressed run state via the title separator instead of prefix glyphs
Kept the bare 'π' brand per owner direction: the separator between the
brand and the session label now carries the state — '>' when it's the
user's turn (idle), animated spinner frames while working, '!' when the
agent is blocked on the user. Disabled ('tui.titleState' off) renders the
pre-state 'π: label' layout. Updated the state/runtime tests to the new
contract.
2026-07-23 17:31:30 +02:00
can1357 0dac3d45b5 Merge PR #4451: feat(coding-agent): reflect agent run state in terminal title (@mattwilkinsonn)
# Conflicts:
#	packages/coding-agent/src/modes/controllers/event-controller.ts
#	packages/coding-agent/src/modes/interactive-mode.ts
2026-07-23 17:31:30 +02:00
can1357 9ee329c9d7 chore: update changelogs 2026-07-18 06:40:52 +02:00
roboomp 3666cb93d2 fix(coding-agent): rejected prose thinking session titles
Rejected markerless prose thinking preambles while preserving marked titles and plain markerless title responses.

Fixes #5252
2026-07-14 17:48:15 +00:00
can1357 93635e7b6a feat(coding-agent): centralized preprocessing and guidance for small models
- Centralized message preprocessing for tiny models to handle noise removal, code block stripping, and context formatting.
- Updated title generation logic to support self-closing tags and improved robustness against partial markers.
- Added structured guidance and system prompts for small models to prioritize output consistency.
- Implemented a title-generation benchmark harness and expanded test coverage for message preprocessing.
2026-07-11 12:28:18 +02:00
roboomp a16c60014c fix(coding-agent): hid reasoning envelope title markers
- Applied the known reasoning envelope filter when deciding whether a title marker is visible.

- Added title extraction regressions for reasoning tag and reasoning fence envelopes before the visible title.

Fixes #5122
2026-07-10 23:27:00 +00:00
roboomp 65b0f05326 fix(coding-agent): preserved markerless thinking titles
- Limited markerless fallback cleanup to leading leaked-thinking envelopes so literal reasoning syntax in plain titles survives.

- Added markerless regression coverage for think tags and thinking-fence titles.

Fixes #5122
2026-07-10 23:12:42 +00:00
roboomp 0420d44d3f fix(coding-agent): preserved reasoning syntax in titles
- Parse only title markers that remain visible after leaked-thinking cleanup so markers inside leaked reasoning are skipped.

- Preserve literal reasoning tag syntax inside the chosen title and cover it with a regression test.

Fixes #5122
2026-07-10 23:00:22 +00:00
roboomp 851186f5de fix(coding-agent): stripped thinking from session titles
- Reused the leaked-thinking healer before parsing title markers so visible reasoning envelopes cannot win extraction.

- Added regression coverage for <thinking> and <think> envelopes that contain internal title tags before the real title.

Fixes #5122
2026-07-10 22:41:27 +00:00
Matt Wilkinson 5e88b24162 test(coding-agent): cover terminal title extension-override precedence
Guards the run-state title fixes: an extension setTitle() override survives run-state changes and spinner ticks verbatim, is superseded by an authoritative session title, and emission dedupes. Red-verified against the pre-fix emit path.
2026-07-09 22:51:32 -04:00
can1357 04783381b4 feat(coding-agent): transitioned session title generation to xml markers
- Replaced tool-based `set_title` invocation with XML-style `<title>` marker tags for session title discovery.
- Implemented robust JSON-unwrapping logic to handle and sanitize title generation outputs.
- Updated model registry in catalog with new model support, provider prefixes, and metadata adjustments.
- Synchronized system prompt documentation and test suites to reflect the new marker-based generation flow.
2026-07-06 17:38:00 +02:00
roboomp 8886a528dc fix(coding-agent): size title/commit/speech/classifier budgets for backends that ignore disableReasoning
Sizing `maxTokens` off the static `model.reasoning` catalog flag cannot
distinguish a thinking model catalogued `reasoning: false` (e.g. Qwen3
served locally via llama.cpp, whose bundled jinja chat template defaults
`enable_thinking: true`) from a model that never emits thinking. The
tight non-reasoning budget was consumed by the thinking preamble before
the useful output could be emitted, so every affected call silently
failed with `stopReason: "length"`.

Drop the `model.reasoning` conditional across every affected online call
site and always reserve the reasoning-safe budget. `maxTokens` is a hard
cap, not a target — non-thinking completions still return in the tiny
happy-path budget.

Sites fixed:
- utils/title-generator.ts       (30   -> 1024)
- utils/commit-message-generator (60   -> 1024)
- tts/speech-enhancer            (512  -> 1536)
- auto-thinking/classifier       online path (8  -> 1024); classifyLocal
                                  keeps its separate LOCAL_ANSWER_MAX_TOKENS
- session/unexpected-stop-classifier online path (16 -> 1024);
                                  classifyLocal keeps ANSWER_MAX_TOKENS

Fixes #4355
2026-07-03 00:47:20 +00:00
can1357 f0f7a5ba89 feat(coding-agent): introduced tiny model role for background tasks
- Added `tiny` as a first-class model role to override online models for lightweight background tasks.
- Updated session title generation, auto-thinking difficulty classification, unexpected-stop detection, and mnemopi backend to resolve via the `tiny` role before falling back to `smol`.
- Updated configuration schema and documentation to reflect the new role precedence.
2026-06-27 07:56:27 +02:00
Tommaso Fontana 9e656c7421 test(omp): align session-title casing tests with main's reconcileTitleCasing
Upstream main 52b8fb156 changed normalizeGeneratedTitle to reconcile a generated title's casing against the user's message instead of forcing Title Case, and updated the tiny-text unit tests but not the title-generator/role-thinking integration suites. The rebase surfaced their stale Title-Case expectations as CI failures. Update the 6 expectations to the reconciled output; no production code change.
2026-06-26 21:46:42 +02:00
can1357 0d29c349ad feat(coding-agent): normalized generated titles to title case
- Applied title-casing to `normalizeGeneratedTitle` outputs using a new internal helper.
- Adjusted tiny text and title generator tests to assert the new title-cased results.
2026-06-15 00:28:08 +02:00
can1357 5a910863c3 feat(coding-agent): added hidden title role for prioritized title model selection
- Added a new built-in `title` model role with `hidden` metadata and updated role definitions and schema.
- Updated title generation to resolve models in `title`, `commit`, then `smol` order and added test coverage for that precedence.
- Filtered hidden roles from selector badges and documented the new built-in role in model/settings docs.
2026-06-15 00:23:29 +02:00
can1357 17ba881c5a feat(coding-agent/utils): added title marker fallback for non-forced tool-choice models
- Added new system prompts that ask models to emit titles inside `<title>` markers when forced tool calls are unavailable.
- Updated `generateTitleOnline` to use marker-based prompting and disable required `set_title` tool calls for models that do not support forced tool choice.
- Adjusted title parsing to extract the `<title>...</title>` value and fall back to stripped marker text when wrapping tags are incomplete.
2026-06-14 01:32:47 +02:00
can1357 fdcc689de0 fix(coding-agent): update default title prompt assertion to surviving anchor
The bundled title-system.md was reworded on main (30959d3ad) after this
branch was cut, so the rebased default-prompt test asserted stale wording.
Anchor on the stable set_title instruction instead.

Addresses review feedback on #2201.
2026-06-10 08:31:33 +02:00
Adryel Dearo ecbc2a3c15 feat(coding-agent): add configurable title system prompt for sessions
- add discovery of `TITLE_SYSTEM.md` and pass it through interactive startup context
- route custom title prompts to online and local tiny title generators via protocol
- update session-title docs and changelog with override behavior
- add tests for prompt discovery, forwarding, and fallback to bundled title prompts
2026-06-10 08:31:32 +02:00
can1357 1b9d9d0851 refactor(catalog)!: split model catalog from pi-ai
Move bundled models, model cache/manager, thinking metadata, effort helpers,
provider descriptors/discovery, wire constants, and model identity utilities
into the new @oh-my-pi/pi-catalog package.

Update pi-ai to keep provider runtime/auth concerns, move catalog provider
metadata into CATALOG_PROVIDERS, and migrate coding-agent, agent, stats, docs,
and tests to import catalog values from pi-catalog.

Split coding-agent model registry helpers into discovery, roles, and models
config modules while preserving registry orchestration.

BREAKING CHANGE: @oh-my-pi/pi-ai no longer exports catalog subpaths such as
/models, /model-cache, /model-manager, /model-thinking, /effort,
/provider-models*, discovery helpers, and provider wire constants; use the
matching @oh-my-pi/pi-catalog subpaths instead.
2026-06-10 04:06:57 +02:00
can1357 9d457f73d9 test: migrated test imports to package subpath exports
- Replaced relative `../src` imports with `@oh-my-pi/pi-ai` and `@oh-my-pi/pi-agent-core` subpaths.
2026-06-08 19:03:55 +02:00
can1357 c10eb5e50e feat(coding-agent): added resolver-based auth retries to image and search tools
- Routed image-gen, inspect-image, and web search providers through `withAuth`.
- Used `reuseInitialApiKey`/`createAuthStorageResolver` for force-refresh and rotate retries.
- Attached HTTP status to thrown errors so the retry classifier detects retryable failures.
2026-06-07 04:49:19 +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 e495f073da feat(coding-agent): deferred session titling past greetings
- Skipped titling for greeting/filler/empty first messages deterministically, retrying on later user messages.
- Let capable title models decline taskless input via a "none" sentinel.
- Guarded against clobbering a name set by a concurrent attempt.
2026-06-04 15:24:53 +02:00
can1357 fb8496fd21 feat(tiny/text): added code block stripping for session title generation
- Added `stripCodeBlocks` to remove fenced code blocks before titling, preventing literal noise (e.g. version strings in UI mockups) from becoming the session title.
- Added `prepareTitleInput` composing strip and truncate steps, updated `formatTitleUserMessage` to use it.
- Added unit tests for stripping logic and an integration test verifying the model never receives code block contents.
2026-05-30 23:13:11 +02:00
can1357 f08e6397db test: added tiny-model role-propagation and title routing tests
- Added `get(path)` support in test `createSettings` to return tiny model setting for `providers.tinyModel`.
- Updated `createSettings` in tests to accept optional `tinyModel` with default `"online"`.
- Added `flushMicrotasks()` and helper factories for test settings, registry stubs, and online model mocks.
- Added tests for `raceFirstNonNull`, `generateSessionTitle` routing, and providers tinyModel enum validation.
2026-05-30 16:55:54 +02:00
can1357 2ebb55134e fix(coding-agent): adjusted reasoning-disable handling and title generation for reasoned models
- Updated OpenAI completions parameterization to honor `disableReasoning` on effort-based compatible models by sending the minimum supported effort.
- Expanded commit and title generation token budgets so reasoning models can return output after internal thinking while non-reasoning calls keep existing limits.
- Switched title generation to request a `set_title` tool call, added extraction from tool-call arguments, and updated tests for the new behavior.
2026-05-22 15:51:32 +09:00