Commit Graph

74 Commits

Author SHA1 Message Date
z80 e3475e6353 fix(config): make live settings reload safe 2026-08-17 21:56:21 -04:00
can1357 6b4823181b test: cleaned test suites and documented filtering guidelines
- Remove redundant definedness, null, and type checks across test suites in multiple packages.
- Clean up unused assertions, metadata tests, and obsolete test cases.
- Add good versus bad test filter guidelines and requirements to project documentation.
2026-08-13 08:28:42 +02:00
Chess Luo 54bd5cd452 fix(coding-agent): clean up legacy Exa and computer settings 2026-08-06 16:36:04 +08:00
can1357 39bc9de52f style: applied biome import order and formatting 2026-08-03 15:26:20 +02:00
can1357 9fb082bf14 refactor(utils): consolidated file locking into pi-utils file-lock
- Moved the coding-agent lock-directory primitive to @oh-my-pi/pi-utils/file-lock
  and migrated settings, MCP config-writer, and security store imports.
- Replaced the stats aggregator's parallel ~200-line token/breaker lock protocol
  with the shared primitive: dead owners reclaimed immediately, live-but-wedged
  owners after STATS_SYNC_LOCK_STALE_MS, unstamped acquisitions after the new
  acquireStaleMs grace (10s).
- Shared primitive now treats EPERM kill probes as live owners.
- Rewrote the stats lock-reclamation regressions against the shared protocol
  and moved the file-lock contract test into pi-utils.
2026-08-03 15:25:03 +02:00
Daniel Anderson-Little a20690a40b feat(tui): add hidden tool activity mode 2026-08-02 22:59:48 -04:00
can1357 03d9b7f048 fix(coding-agent): canonicalized config paths in failure-safety test injections
The lock-race and EPERM regression tests compared injection predicates
against the uncanonicalized temp config path, but the atomic writer
resolves it via realpath; on macOS /var -> /private/var made the mocks
never fire and both tests failed. Compared against the realpath instead.
2026-07-27 04:58:26 +02:00
Ant39140 d68c9dadf9 fix(coding-agent): rejected configs quarantined during startup 2026-07-27 03:49:51 +08:00
Ant39140 20d96304f2 fix(coding-agent): prevented invalid configs from being overwritten
- Treated missing files separately from malformed or unreadable configs.
- Backed up malformed YAML and wrote settings atomically without dropping pending changes.
- Reported success only after saving, with regression tests for global and project configs.
2026-07-27 03:26:40 +08:00
roboomp ca0d3e3e5b fix(config): resolved shell setting source paths
Tracked the effective global, project, overlay, or runtime source of shellPath so resolution errors identify the configuration users must edit.

Covered custom agent directories and higher-precedence settings layers with focused regressions.

Fixes #6579
2026-07-25 05:32:40 +00:00
can1357 fcf2274b2f fix(coding-agent): cancelled pending saves on discarded settings instances
- discarding a Settings instance (test reset, re-init) now disarms its
  debounced save timers and refuses chained background writes, so a
  dropped instance can never race a successor's file locks
- resetSettingsForTest sweeps a weak registry of ALL constructed
  instances, covering isolated (non-singleton) instances too
- fixes deterministic cross-file failure of the model-role replay test
  when settings-reload-cwd ran first in the same process
2026-07-23 20:59:52 +02:00
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 0f54c0df70 fix(tools): autoqa consent handling from default off to opt-in 2026-07-23 13:24:45 +02:00
roboomp d30c5e8603 fix(settings): cleared persisted pending role writes
Serialize queued global saves and remove opportunistically persisted roles from the pending set after a successful write when their value has not changed again. This prevents a redundant follow-up save from replaying stale local values over newer external edits.

Expanded the locked-save regression to externally change the same role after the first write and verify flush leaves that newer disk value intact.
2026-07-22 04:27:25 +00:00
roboomp 640249ef33 fix(settings): preserved role writes during pending saves
Snapshot model roles when each save starts and merge any newer pending values before replacing the in-memory global settings. This keeps a second model switch intact while an earlier locked save is in flight.

Added a deterministic regression test that blocks the first file-lock operation, changes another role, and verifies both memory and disk.
2026-07-22 04:19:35 +00:00
roboomp 14a8b709cc fix(settings): merge global model roles per-role on save
Global setModelRole marked the whole modelRoles path modified and
saveNow overwrote the freshly re-read disk record with the stale
in-memory map, clobbering concurrent/external per-role edits despite
the re-read intended to preserve them. Track modified global roles
individually and merge only those into the re-read file, mirroring the
project save path.

Fixes #6260
2026-07-22 04:09:55 +00:00
roboomp ec6511524e fix(coding-agent): migrate legacy nested autoqa/todo settings keys
The v17 rename (46ad908) of dev.autoqa.consent -> dev.autoqaConsent and
todo.reminders.max -> todo.remindersMax added no case to
Settings.#migrateRawSettings, so pre-rename nested or quoted-dotted config
left the leaf beneath the parent path. The parent then resolved to an
object, making dev.autoqa truthy (isAutoQaEnabled saw Auto QA enabled) and
discarding the reminder limit.

Lift both legacy leaves onto the new keys during raw settings load via a
shared migrateNestedLeafRename helper: an explicit new key wins, a
separately configured parent boolean is preserved, an irrecoverable
object-valued parent is dropped so the schema default applies, and only the
new representation persists on save.

Fixes #5632
2026-07-16 01:23:01 +00:00
can1357 46ad908245 fix(coding-agent): renamed settings keys to avoid nested-value lookup collisions
- Updated schema and runtime paths to use `dev.autoqaConsent` and `todo.remindersMax`, including auto-QA consent reads/persistence and todo reminder limit checks.
- Adjusted settings expectations so obsolete BM25-discovery keys were dropped on load and `tools.xdev` now kept its default unless explicitly set.
- Added/updated tests for the setting key migration and refreshed issue-consent flows, plus a new `refreshMCPTools` test for steered `xdev-mount-notice` updates without prompt rebuilds.
2026-07-15 19:08:37 +02:00
can1357 9afedb591e feat(coding-agent): added opt-in task prewalk and tightened --tools and xdev behavior
- Added a `task.prewalk` option (default `false`), removed default task `prewalk` flags, and updated prewalk resolution so bunded generic task execution only prewalks when explicitly enabled.
- Enforced strict `--tools` validation in CLI parsing, making unknown tool names fail fast with `CliUsageError` instead of being silently filtered.
- Migrated legacy discovery settings (`tools.discoveryMode`, `tools.essentialOverride`, MCP discovery keys) into updated `tools.xdev` handling with preserved explicit override behavior.
- Hardened xdev/ACP execution flow by capping `docsAll` payloads with overflow listing and remapping `xd://` dispatches/approval gating for correct execute/read behavior and reduced duplicate prompts.
2026-07-15 18:39:36 +02:00
can1357 5ff277349c refactor(coding-agent): consolidated tool surface onto xd:// devices and hub
- Added the `xd://` virtual device protocol (`internal-urls/xd-protocol.ts`, `tools/xdev.ts`): tools declaring `loadMode: "discoverable"` are unmounted from the request tools array and driven via `read xd://` (list/docs+schema) and `write xd://<tool>` (execute), gated by the `tools.xdev` setting (default on) and inlined into the system prompt.
- Merged the `irc`, `job`, and `launch` tools into a single `hub` tool (`tools/hub/`, `async/job-manager.ts`): messaging keeps `send`/`inbox`/`list`, job control maps to `wait`/`cancel`/`jobs`, process supervision keeps `start`/`logs`/`stop`/`restart`/`describe` with `ps`, and the unified `wait` races background jobs against peer messages; SDK `IrcTool`/`JobTool`/`LaunchTool` are replaced by `HubTool`.
- Removed the hidden `resolve` tool in favor of the `xd://resolve`/`xd://reject`/`xd://propose` resolution devices, auto-including `write` whenever a deferrable tool or plan mode is present.
- Removed the BM25 tool-discovery system: the `search_tool_bm25` tool, the `tool-discovery` module, the `tools.discoveryMode`/`mcp.discoveryMode`/`mcp.discoveryDefaultServers`/`tools.essentialOverride` settings, per-tool MCP selection, and the `mcp_tool_selection` message type.
- Unified tool presentation on `ToolLoadMode` (`essential`|`discoverable`), replacing the custom-tool `xdev?: boolean` opt-out; custom, extension, MCP, RPC host, image-generation, and TTS tools now default to `discoverable`, and added a `satisfies` predicate to `SoftToolRequirement`.
- Removed the standalone `ssh` command tool and `ssh/ssh-executor` (the `ssh://` read/write/search protocol stays), and made `--tools` address hidden built-ins.
- Updated collab-web to render `xd://` dispatches and `hub` op families, dropped the `search_tool_bm25`/`ssh`/`report-finding` renderers, refreshed tool docs and prompts, and migrated the affected tests and changelogs.
2026-07-15 15:16:29 +02:00
can1357 59d08172c1 feat(coding-agent): introduced model hub for unified management and search
- Replaced the legacy model selector with a full-screen Model Hub, introducing mouse support and a fuzzy-searchable browser.
- Integrated comprehensive model management, including role assignment, thinking-level visualization, and manual provider discovery.
- Implemented a cancellable OAuth login flow and integrated it directly into the Model Hub for provider authentication.
- Centralized model logic and migrated existing tests to support the new component architecture.
2026-07-11 15:10:53 +02:00
roboomp 668741b40c fix(config): preserved selected path in clones
Copied the selected main config path into per-CWD settings clones so config.yaml-backed sessions keep writing to config.yaml.

Added regression coverage for cloneForCwd updates against preseeded config.yaml.
2026-07-09 18:27:22 +02:00
can1357 9ce8b69b34 fix(config): respected preseeded yaml settings
First-run settings load now discovers an existing config.yaml next to
config.yml, loads it as the main settings file, and keeps writing back
to the discovered path instead of creating a stub config.yml beside it.

Refs #4914
2026-07-09 18:27:22 +02:00
can1357 23c81ead9b refactor(coding-agent/config): cached edit model variants and optimize settings parsing
- Introduced an `#editVariantCache` to memoize resolved edit modes for model variants.
- Replaced the generic `shallowStringRecord` helper with specialized, type-safe parsing methods for model variants and roles.
- Invalidated the cached edit variants during settings rebuilds and verified correct cache refreshment across project directories.
2026-07-01 04:45:59 +02:00
can1357 053da98ddc feat: removed pi dialect and its associated infrastructure
- Removed the pi dialect implementation and associated source files.
- Updated dialect resolution, factory registration, and type definitions to exclude pi.
- Cleaned up settings schema and user options to remove pi-related configurations.
- Deleted corresponding test suites covering pi dialect functionality, in-band tools, and examples.
2026-06-27 08:37:25 +02:00
can1357 b72b83884d Merge PR #3216: feat: add provider in-flight request limits (@H4vC)
# Conflicts:
#	packages/coding-agent/src/modes/components/settings-selector.ts
2026-06-27 01:39:32 +02:00
can1357 8e206dbd54 Merge PR #3056: feat(coding-agent): add native terminal progress setting (@lederniermagicien) 2026-06-27 01:39:30 +02:00
can1357 ae1650d689 refactor: renamed search and find tools to grep and glob
- Renamed the `find` and `search` tools to `glob` and `grep` respectively across the codebase to improve command clarity.
- Implemented full-stack support for the renamed tools, including CLI arguments, system prompts, SDK exports, and tool registration.
- Added automated migration logic in `settings` to transform legacy `find` and `search` configuration keys to their new equivalents.
- Updated the `collab-web` renderer registry to ensure backwards compatibility with legacy tool outputs.
2026-06-27 00:57:55 +02:00
can1357 c1a0c968b0 feat(coding-agent): changed inlineToolDescriptors to a three-way enum
- Changed `inlineToolDescriptors` from a boolean to a three-way enum (`auto` | `on` | `off`) to allow per-model defaults.
- Implemented `auto` logic which defaults to inlining descriptors specifically for Gemini models.
- Added a migration to automatically map existing boolean values to `on` or `off` to maintain backward compatibility.
2026-06-26 22:29:28 +02:00
can1357 ac904fc70c fix: patched Kimi model edit mode fallback
- Added a fallback from `hashline` to `replace` mode for Kimi-family models to resolve compatibility issues.
- Introduced `PI_STRICT_EDIT_MODE` environment variable to bypass automatic model-specific edit-mode fallbacks.
- Updated `getEditVariantForModel` to perform case-insensitive matching for model variant configurations.
- Added comprehensive unit tests for edit mode resolution and settings configuration.
2026-06-26 13:17:35 +02:00
Brit b1deca6606 feat: add provider in-flight request limits 2026-06-22 02:11:41 +02:00
oldschoola 3f7c56886c fix(test): use TempDir for Windows-safe cleanup in settings-manager tests
Replace bare fs.rmSync (no retries) with TempDir.removeSync (40x25ms
retry on EBUSY) in settings-manager.test.ts. The test was creating temp
dirs manually with fs.mkdirSync and cleaning up with fs.rmSync, which
fails on Windows when SQLite file handles haven't been released yet.

TempDir.removeSync retries on EBUSY/EPERM/ENOTEMPTY with backoff,
matching the pattern used by other agent-session tests. On Linux/macOS
(CI) this resolves completely; on Windows the retry budget helps but
the underlying Settings DB handle release may still exceed the window.
2026-06-19 17:08:32 -07:00
Magicien 40b498ffb6 feat(coding-agent): add native terminal progress setting 2026-06-19 18:00:41 +01:00
can1357 7864a1363c feat(coding-agent): consolidated macOS power settings into enum
- Replaced four individual power boolean settings with a single `power.sleepPrevention` enum for improved configuration management.
- Implemented automatic migration logic in `Settings.init` to map legacy macOS power booleans to the new enum levels.
- Updated `AgentSession` to utilize the new `sleepPrevention` enum for macOS power assertion lifecycle management.
- Changed default value of `display.cacheMissMarker` to `false` to suppress cache-miss markers.
- Added comprehensive unit tests in `settings-manager.test.ts` to verify backward-compatible migration behavior.
2026-06-19 08:54:20 +02:00
usr_bin_roygbiv bc5f25af23 fix(coding-agent/config): support comments in JSON config migration 2026-06-18 16:05:06 -05:00
Alexander Kirilin 8f6982eb83 feat(coding-agent): add startup splash setting 2026-06-17 10:28:07 -04:00
Alexander Kirilin 89d2ed8f66 fix(minimax): expose owned dialect selectors 2026-06-17 12:24:49 +02:00
can1357 e1814d9a08 refactor: renamed grammar module to dialect with unified transcript rendering
- Renamed ToolCallSyntax type to Dialect and Grammar interface to DialectDefinition across all packages.
- Moved grammar directory to dialect and updated all import paths in agent, ai, catalog, and coding-agent packages.
- Added renderTranscript and renderThinking methods to DialectDefinition, enabling native dialect-aware conversation serialization.
- Consolidated rendering utilities into new dialect/rendering.ts with shared helpers for ChatML, legacy text, and dialect-specific formatting.
- Updated conversation serialization in agent and coding-agent to use dialect.renderTranscript() for native turn envelope rendering.
2026-06-15 13:58:12 +02:00
can1357 641be81478 feat: added control over fabricated tool-result stream handling
- Added an abortOnFabricatedToolResult option to Agent and AgentLoopConfig to choose whether in-band fabricated tool results are aborted or drained.
- Propagated the option through agent loop wiring into wrapInbandToolStream so fabrication is aborted only when enabled.
- Exposed the setting in coding-agent as tools.abortOnFabricatedResult and wired it through session creation with a true default.
2026-06-15 07:44:03 +02:00
can1357 fbba331f8a feat(cross-cutting): added multi-syntax in-band tool-call support for runtime tool conversion
- Added optional Agent and SDK tool-call syntax controls (`toolCallSyntax`, `PI_OWNED_TOOLS`) for owned calls.
- Added in-band grammar scanners and renderers for Anthropic, DeepSeek, GLM, Hermes, Kimi, PI, and Qwen3.
- Added supportsTools propagation and model schema updates to route unsupported models to fallback syntax.
- Replaced stream-markup parsing with syntax-specific in-band scanners and event conversion.
2026-06-15 07:33:24 +02:00
can1357 b8e4da23d0 ci(ci): refactored CI setup and test-state isolation for coding-agent workflows
- Added a setup-system-deps action with preloaded-runner guards and apt fallbacks.
- Updated CI workflows to download Linux x64 native artifacts and gate on native job success.
- Renamed coding-agent fast mode to singleton in scripts and test partitioning logic.
- Added settings test-state begin/restore helpers with recursive cleanup in affected tests.
2026-06-14 22:37:05 +02:00
metaphorics 42626b8c44 feat(coding-agent): make task.eager and todo.eager three-level eagerness enums 2026-06-14 11:09:29 +09:00
can1357 212e05dbbb feat: added Codex saved reset-credit redemption flow to usage tooling
- Added Codex reset-credit models, endpoints, and redemption methods.
- Added reset-credit usage data and cache invalidation for successful redemption.
- Added `/reset-usage` slash command and interactive account selector flow.
- Added contract tests for reset-credit listing, fallback, and consume outcomes.
2026-06-12 05:20:08 +02:00
can1357 6091931b9d feat(coding-agent): added scoped snapcompact system-prompt imaging modes
- Added `snapcompact.systemPrompt` enum modes `none`, `agents-md`, and `all` with default `none`.
- Added AGENTS.md-mode context extraction and mode-specific system-frame injection.
- Updated `/context` and `/debug` request reporting to include snapcompact deltas, swap reasons, and estimates.
- Normalized legacy boolean `snapcompact.systemPrompt` values to enum strings for compatibility.
2026-06-12 05:14:34 +02:00
can1357 35474d98be refactor(config): moved lastChangelogVersion to marker file
- Stored last-seen version in ~/.omp/agent/last-changelog-version so version bumps no longer dirty user configs.
- Migrated the legacy config.yml key into the marker, never clobbering a newer existing marker.
- Added read/write helpers and migration tests.
2026-06-10 02:22:33 +02:00
can1357 d574968da4 fix(coding-agent/config): hardened settings hooks against callback exceptions
- Replaced manual settings callback sets with a shared `SettingSignal` that snapshots listeners and skips over individual callback failures.
- Updated `provider.appendOnlyContext`, `statusLine.sessionAccent`, and `hindsight` hook dispatch to use the new signal and added a Settings test confirming a throwing append-only listener does not stop other listeners.
- Adjusted the duplicate-tool-results regression test to handle `tool_calls` being absent before mapping IDs.
2026-06-08 02:38:18 +02:00
can1357 71624ee47b fix(coding-agent): fixed stale settings and session-accent cache handling
- Cached setting path segments and memoized `Settings.get()` results, clearing caches on updates.
- Triggered session-name and session-accent callbacks only when effective values changed, with error-safe dispatch.
- Memoized status-line and interactive accent resolution with cache invalidation on settings/theme/session changes.
- Added regression tests for keybinding precedence, status-line, settings, and accent cache behavior.
2026-06-08 02:30:44 +02:00
can1357 ea105b4211 refactor(packages/coding-agent): reorganized notification flow and tests
- Updated completion and ask notifications to pass structured payloads.
- Updated completion and ask notifications to include explicit message metadata fields.
- Adjusted abort-guard and retry-capability tests for the new notification/options behavior.
2026-06-04 00:59:59 +02:00
can1357 68430dee5c chore: renamed mnemosyne package to mnemopi
- Updated package name, directory, and binary from mnemosyne to mnemopi.
- Updated all lockfile references and workspace paths accordingly.
2026-05-31 08:45:12 +02:00
can1357 def901af5c fix(coding-agent/config): preserved runtime modelRole overrides when saving model role changes
- Added a shallow string-record sanitizer to normalize unknown model role values before applying updates.
- Updated setModelRole and overrideModelRoles to base persistence on global roles while retaining matching runtime overrides.
- Added model role override tests covering non-persistent temporary overrides, override clearing, and consistency after role updates over overrides.
2026-05-21 16:46:46 +09:00