24 Commits

Author SHA1 Message Date
can1357 a59fc754b6 test(tui): covered welcome model synchronization 2026-08-16 02:03:17 +02:00
can1357 b279db1790 test: refactored test suites to eliminate time-based sleeps and polling loops
- Replaced time-based sleeps and polling loops with event-driven promise resolvers and fake timers across agent and tool tests.
- Migrated test suites to share in-memory auth storage and fixtures using lifecycle hooks.
- Updated catalog model definitions, metadata, and configurations.
2026-08-13 19:32:22 +02:00
can1357 bc39ffa265 feat: introduced omptype validation package and migrated workspace dependencies
- Introduce `@oh-my-pi/omptype` as a new ArkType-compatible schema validation package featuring a lazy JIT runtime, JSON Schema emission, and compatibility adapters.
- Replace `arktype` across workspace packages and test utilities with `@oh-my-pi/omptype`.
- Add benchmark suites, tests, and documentation for the new validation engine and adapters.
- Update workspace build, test runner, and release configurations to include the new package.
2026-08-03 21:56:48 +02:00
can1357 21b3764b08 refactor(coding-agent): replaced xdevregistry with state interface and helpers
- Replaced the `XdevRegistry` class with the `XdevState` interface and pure helper functions across core and session tools.
- Updated session configurations, tool execution, and renderers to utilize canonical tool map initialization and sharing.
- Adapted unit tests and mocks to use `XdevState` and associated helper functions for permission and dispatch verification.
2026-07-28 03:34:36 +02:00
can1357 936fdbe4a7 Merge PR #6013: fix(coding-agent): preserve plan exit rollback state (@any-victor) 2026-07-20 22:50:03 +02:00
Victor Araújo 1d667039d1 refactor(coding-agent): share tool presentation apply path 2026-07-19 14:45:41 -03:00
Victor Araújo 7f10e13bbe fix(coding-agent): preserve plan tool presentation 2026-07-19 14:45:41 -03:00
Victor Araújo 8a8ff498b3 fix(coding-agent): preserve plan exit rollback state 2026-07-19 14:45:41 -03:00
roboomp 3f67489a9f fix(coding-agent): preserved model on plan resume
Plan-mode reconciliation now keeps the model restored from the session journal instead of reapplying the current plan role.

Fixes #6015
2026-07-18 22:07:22 +00:00
Victor Araújo 51ac313a63 fix(coding-agent): rolled back failed tool refreshes 2026-07-16 21:17:28 -03:00
Victor Araújo 188b9667c6 fix(coding-agent): preserved failed plan exits 2026-07-16 21:04:09 -03:00
Victor Araújo 8d06327127 fix(coding-agent): preserved xdev mode transitions 2026-07-16 19:45:01 -03: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 c46216742b feat(hashline): implemented tag-based patch path recovery
- Automatically rebind edits to the correct file when an authored path does not exist but the filename and snapshot tag uniquely match a file read earlier in the session.
- Prevent path recovery for paths that would escalate write privileges, ensuring compatibility with read-only internal URL targets.
- Surface warning messages to the model and user upon successful path recovery to encourage correct future path usage.
2026-06-25 13:14:05 +02:00
roboomp 6f3d6ba2e4 fix(coding-agent): restricted plan-mode write activation to built-ins
Tracked current-registry built-in provenance through AgentSession so plan mode
only force-activates the built-in write implementation. Extension or SDK tools
that shadow the name `write` stay inactive, preserving plan mode's read-only
contract through the built-in write/edit guard.

Added a regression that registers a shadowing write tool without built-in
provenance and verifies plan mode does not activate it.
2026-06-21 04:04:14 +00:00
roboomp a7662b4208 style: bun run fix 2026-06-21 03:54:32 +00:00
roboomp 832810e212 fix(coding-agent): force-activated write tool while plan mode is live
Plan-mode entry only added `resolve` to the active toolset, so when
`tools.discoveryMode: "all"` left `write` hidden behind
`search_tool_bm25` the agent was stuck with `edit` to create the plan
file — which fails on a non-existent path and stalls the planning
turn. `#enterPlanMode` now augments the active set with both `resolve`
and `write` whenever the registry built them, matching what
`plan-mode-active.md` instructs the model to use, and `#exitPlanMode`
still restores the pre-plan toolset verbatim.

Fixes #3165
2026-06-21 03:54:11 +00:00
can1357 a050474af7 feat: migrated validation schemas and tool definitions from Zod to ArkType
- Migrated all wire protocol, schema definitions, and tools validation from Zod to ArkType across multiple packages.
- Updated extension runtimes, custom tools loader, and TypeBox compatibility shim to expose and use ArkType instances.
- Added a comprehensive ArkType migration guide, validation parity tests, and helper utilities.
- Removed redundant PDF asset routing and parsing implementations from the read tool.
2026-06-18 00:59:53 +02:00
ephraimduncan 442648be56 fix(coding-agent): base plan-default freshness on built branch context
A blocklist of `message`/`mode_change` entries missed context-bearing entries
that carry no literal message — a compacted branch, a branch summary, or a
custom-role message — which buildSessionContext still feeds the model. Such a
resumed session was misclassified as fresh and auto-entered plan mode, overriding
its restored mode.

Gate on buildSessionContext().messages (the resolved branch context — messages,
custom messages, branch summaries, and compaction summaries) plus a `mode_change`
entry check. SDK startup metadata and extension `custom` state entries stay
excluded. Added a regression test for a compacted session with no trailing
message.
2026-06-05 12:36:09 +00:00
ephraimduncan c426f2517a fix(coding-agent): base plan-default freshness on conversation/mode entries
The startup-metadata allowlist was incomplete: an extension that persists a
custom entry during session_start (initHooksAndCustomTools runs just before this
guard) made a brand-new session look non-fresh, so plan.defaultOnStartup never
engaged for those users.

Invert to a blocklist: a session is brand-new unless it has a conversation
`message` or a user `mode_change` (which #reconcileModeFromSession just restored).
SDK startup metadata and extension custom entries are ignored. This satisfies the
fresh, continue-created, resumed-conversation, and toggled-off-mode cases at once.
Added a regression test for the extension custom-entry case.
2026-06-05 12:18:52 +00:00
ephraimduncan d6dd9d4709 fix(coding-agent): only auto-enter plan mode on a truly fresh session
The previous gate keyed off the absence of message entries, but a session can
carry a user mode_change (e.g. plan enabled then toggled off → mode_change
"none") with no message yet. #reconcileModeFromSession restores that off state,
then the startup default wrongly re-entered plan mode because there was no
message entry.

Gate on an allowlist of the SDK's fresh-session startup metadata (model_change,
thinking_level_change, service_tier_change, mcp_tool_selection): a session is
brand-new only when every entry is one of those. Any message or user mode_change
means it is not fresh and its reconciled mode stands. Added a regression test
for the plan→off→continue case.
2026-06-05 11:52:33 +00:00
ephraimduncan d98bedd8fc fix(coding-agent): treat startup metadata as a non-conversation new session
The plan.defaultOnStartup gate keyed off getEntries().length === 0, but
createAgentSession appends startup metadata (model_change / thinking_level_change
/ service_tier_change) for a brand-new session before InteractiveMode.init()
runs. So a genuinely new session reached the guard with entries already present
and never entered plan mode (the unit harness bypassed the SDK path, hiding it).

Gate on the absence of conversation messages (entry.type === "message") instead.
A fresh session — including a --continue/auto-resume that created one — carries
only metadata and still honors the default; a session with restored conversation
keeps its reconciled mode. Added a regression test seeding model/thinking-level
metadata.
2026-06-05 11:22:49 +00:00
ephraimduncan df114ae042 fix(coding-agent): gate plan.defaultOnStartup on empty session history
The startup plan-mode auto-entry gated on the CLI-derived `resuming` flag
(continue || resume || fork). But `omp --continue` with no recent session
calls SessionManager.continueRecent(), which creates a fresh, empty session
while `resuming` stays true — so the new setting was skipped on what is really
a brand-new session.

Gate on the actual signal instead: this.sessionManager.getEntries().length === 0,
the same "has prior history" check the auto-resume path already uses. A session
that opens empty (new, or a continue/auto-resume that found nothing) honors the
default; one with restored history keeps its reconciled mode. Removed the now-dead
`resuming` InteractiveModeInitOptions field and its init() argument (the runtime
flag is still used for setup-scene selection). Updated the regression test to
seed real history and corrected the CHANGELOG wording.
2026-06-05 10:59:21 +00:00
ephraimduncan fca5c0adf1 feat(coding-agent): added plan.defaultOnStartup to launch new sessions in plan mode
New boolean setting (Tasks tab, default off) that auto-enters plan mode at the start of every new interactive session. Scoped to launch via the existing resuming flag, so resumed/continued/forked sessions keep their reconciled mode and the plan-approval -> execution handoff clear is never dragged back into plan mode. Silent no-op when plan.enabled is off or another mode is active; hidden in the settings UI behind a planModeEnabled condition.
2026-06-04 21:37:33 +00:00