Commit Graph

135 Commits

Author SHA1 Message Date
can1357 a58584ff3c feat: implemented shared serialization utilities and standardized inventories
- Added shared Python call and literal serialization utilities with multiline verbatim support.
- Standardized tool inventories to format as an OpenAI-Harmony functions namespace using TypeScript declarations.
- Updated tool normalization and rendering functions to accept options objects and default to Python-syntax examples.
- Refactored Gemini dialect rendering to leverage shared serialization functions directly.
2026-08-03 05:06:49 +02:00
Slava Zavadsky 9885ee34fc fix(agent): stop leaking scout into prompts when it is disabled
Hard-coded 'scout' references reached the model even when the scout
agent was disabled via task.disabledAgents or absent from the session
spawn list. Gate every such reference on scout actually being spawnable:
the task tool description, the delegation gates, the plan-mode and
workflowz notices, the glob/grep/ast-grep guidance, and the task
specialization advisory. Prompt shape is otherwise unchanged; only
erroneous references to the unavailable subagent are dropped.

Closes #7313
2026-08-01 23:50:33 -04:00
roboomp 08c80f7da0 fix(coding-agent): scope context rediscovery to session settings
Threaded the session's disabledExtensions into context-file rediscovery so a concurrently-created session's global settings cannot toggle another session's context entries.

Fixes #7258
2026-08-01 11:36:34 +00:00
roboomp d77dd10e5b fix(agent): suppress redundant xd:// mount notice after catalog rebuild
On a fresh session with deferred MCP discovery the post-discovery prompt
rebuild renders the full mounted xd:// device catalog, yet the pre-user
xdev-mount-notice re-listed the same names because announcement tracking was
never updated by the rebuild. This double-billed the entire mounted MCP
inventory into the first model request.

rebuildSystemPrompt now reports the catalog it rendered via
BuildSystemPromptResult.xdevCatalogNames, and applyActiveToolsByName folds
those devices into the announced-mount baseline (marking them announced and
dropping them from the pending delta). Notices for mount changes the rebuild
did not expose, and all unmount notices, remain intact.

Fixes #7139
2026-07-31 02:27:38 +00:00
Kyle McCleary 089a9963f8 feat(security): OMP-native security subsystem (planner handoff) 2026-07-29 18:47:51 -07:00
Nik Divjak 630f9e5324 fix(xdev): bound device summaries in UTF-8 bytes and flag untrusted metadata
Catalog summaries of mounted xd:// devices are inlined verbatim into the
system prompt. External devices (MCP servers, plugins) supply that text, and
it was bounded only by character count: a summary of multi-byte script passed
roughly three times the intended budget, and control characters survived into
the prompt where they can forge structure.

Summaries now go through a single sanitize-and-bound step that strips C0/C1
control characters and bounds the result in UTF-8 bytes via the central
truncateHeadBytes helper, so a cut lands on a code point boundary and never
renders a partial code point. The built-in/external distinction is derived
once per entry, and that same boolean both selects the description cap and is
exposed as `dynamic`, so the cap and the flag cannot disagree. The prompt uses
the flag to state that dynamic summaries are untrusted metadata, and the mount
notice says the same for newly appeared devices.

(cherry picked from commit 5989da6235d820bc687779a791e655e6f1b2df0f)
2026-07-29 23:09:00 +02:00
usr-bin-roygbiv 3c5c2514be fix(coding-agent): preserve tool metadata builder API 2026-07-27 01:05:33 +00:00
usr-bin-roygbiv 7cbc5a57d3 perf(coding-agent): avoid unused compact tool metadata 2026-07-27 00:40:28 +00:00
usr-bin-roygbiv b9504f65e7 feat: add native Codex computer use 2026-07-24 01:40:04 +00:00
can1357 26726fdcb9 Merge PR #6255: add dynamic multi-root workspace context (@maatheusgois-dd) 2026-07-23 17:30:33 +02:00
maatheusgois-dd 5c312e23ff Fix biome lint: import wrapping, import sorting, formatting
Co-authored-by: oh-my-pi <https://omp.sh>
2026-07-22 11:42:48 -03:00
maatheusgois-dd aa15496d29 Await providedWorkspaceTree when it's a Promise before merging root agentsMdFiles
Fixes a crash: createAgentSession passes workspaceTreePromise (a
Promise) as providedWorkspaceTree. The merge path accessed
primary.agentsMdFiles without awaiting, rejecting the system-prompt
prep and falling back to an empty tree.

Co-authored-by: oh-my-pi <https://omp.sh>
2026-07-22 01:55:29 -03:00
maatheusgois-dd 1704e3fd5a Normalize additional dirs on /move and discover nested AGENTS.md from added roots
- Filter #additionalDirectories when moveTo changes cwd so the new cwd
  is never also listed as an additional root (session-manager.ts)
- Build workspace tree for each additional root to discover nested
  AGENTS.md files under added roots, merging agentsMdFiles into the
  primary set (system-prompt.ts)

Co-authored-by: oh-my-pi <https://omp.sh>
2026-07-22 01:47:46 -03:00
maatheusgois-dd ab0c25e058 Fix 2nd-round AI review: context files for all roots, merge on resume, fork copies roots
- Always augment context files with additional root context, even when
  createAgentSession passes preloaded contextFiles (system-prompt.ts)
- Merge configured dirs with existing restored roots on resume instead
  of replacing them (sdk.ts)
- Copy additionalDirectories from source header in forkFrom so forks
  preserve the multi-root set (session-manager.ts)
- Add test for forkFrom preserving additionalDirectories

Co-authored-by: oh-my-pi <https://omp.sh>
2026-07-22 01:14:13 -03:00
maatheusgois-dd 0a4ca2fe20 Load project context files for all workspace roots, not just cwd
When additional workspace directories have their own AGENTS.md/rules,
the agent now discovers and injects those context files alongside the
primary cwd's context. This prevents the agent from editing under a
root without seeing the rules that apply there.

Co-authored-by: oh-my-pi <https://omp.sh>
2026-07-22 01:06:55 -03:00
maatheusgois-dd 32d8b84e26 Add dynamic multi-root workspace context (#2569)
A session now carries an ordered list of workspace directories beyond cwd,
managed live from the terminal. New /add-dir, /remove-dir, and /dirs slash
commands let you add and remove folders mid-session; the repeatable --add-dir
CLI flag seeds them at launch, and the workspace.additionalDirectories
setting persists defaults per project. Additional roots are persisted in the
session header, survive reopen/fork/move, and are surfaced to the agent in the
system prompt so it knows they exist and can read/grep/glob them by absolute
path. Design aligns with the endorsed community implementation on
feature/session-workspace.

Co-authored-by: oh-my-pi <https://omp.sh>
2026-07-21 23:38:32 -03:00
roboomp c0966d0f64 fix(prompting): preserved absolute working directory
Removed display-only home shortening from the provider-facing project prompt and covered home-relative project paths with a regression test.

Fixes #6100
2026-07-21 21:07:11 +00:00
can1357 261ce6c370 fix(prompting): preserved direct tools sharing xd names
Kept top-level custom tool descriptors when a retained xd device uses the same name. Added compact and inline inventory coverage for mounted-only and dual-presentation tools.
2026-07-17 20:44:34 +02:00
roboomp 6b88e69057 fix(prompting): hid xd tools from direct inventory
- Filtered xd-mounted names from compact and inline tool inventories.

- Added regression coverage for both inventory rendering modes.

Fixes #5797
2026-07-17 07:09:23 +00:00
can1357 3601692c8d merged PR #5515: fix(skills): reload runtime skill state 2026-07-16 03:31:59 +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 cda994a435 Merge PR #5504: fix(prompt): restore non-Linux CPU model metadata (@roboomp) 2026-07-14 23:11:11 +02:00
roboomp 19674b8dfa fix(skills): reloaded runtime skill state
- Rediscovered enabled skills across TUI, ACP, and RPC plugin reloads.
- Rebuilt skill commands, system prompts, tool snapshots, and skill URL resolution.
- Hot-refreshed managed skills after manage_skill create, update, or delete.

Fixes #4996
2026-07-14 20:01:45 +00:00
roboomp 6b12dd4d48 fix(prompt): restored non-linux cpu model metadata
Restored the previous best-effort os.cpus() lookup outside Linux while preserving the /proc/cpuinfo startup path on Linux.

Fixes #4755
2026-07-14 19:32:29 +00:00
can1357 1b490044ff feat(coding-agent): centralized task orchestration and prompt policy logic
- Centralized task concurrency and delegation logic by moving instructions from individual tool descriptions to the system prompt.
- Introduced conditional system prompt logic to handle model-specific task policies, including support for GPT-5.6.
- Added infrastructure for task concurrency normalization and IRC steering state within the system prompt configuration.
- Refactored prompt inputs and session logic to enable dynamic system prompt updates based on model-specific policy cohorts.
2026-07-11 00:03:53 +02:00
can1357 83896d274a merge PR #4644: fix(prompting): hide eval guidance when disabled 2026-07-08 15:19:36 +02:00
can1357 c641e11790 merge PR #4643: fix(coding-agent): use local date in system prompt 2026-07-08 15:19:36 +02:00
roboomp 0de57eb75e fix(cli): avoided os cpus during startup
Read the Linux CPU model from /proc/cpuinfo during system prompt construction instead of calling os.cpus(), which can synchronously probe every logical CPU frequency file on many-core hosts.

Fixes #4712
2026-07-06 13:50:30 +00:00
Christian Stewart b765657f28 fix(prompting): hide eval guidance when disabled
Stop advertising eval in the default prompt and workflow notice when no eval
backend is enabled. Gate bash guidance on live eval backend availability and
cover the disabled-backend rendering contract.

Agent-Milestone: tooling: hide eval prompt guidance when eval backends are disabled

Signed-off-by: Christian Stewart <christian@aperture.us>
2026-07-05 16:04:15 -07:00
Christian Stewart 722a06abce fix(coding-agent): use local date in system prompt
Signed-off-by: Christian Stewart <christian@aperture.us>
2026-07-05 16:03:44 -07:00
roboomp 80d80b6bee fix(coding-agent): fell back for kernel field when os.version returns unknown
Bun on macOS 15+ (Darwin 24/25) returns the literal string "unknown" from
os.version() when uv_os_uname() cannot populate the version field. That
value was piped straight into the <workstation> block as `Kernel:
unknown`, and the model then guessed the OS glyph from the ambiguous
signal — displaying a Windows logo on Macs.

Fall back to `${os.type()} ${os.release()}` (uname -s + uname -r, e.g.
`Darwin 25.5.0`) whenever os.version() is empty or the literal
"unknown". Linux keeps its build string when Bun returns one.

Fixes #4141
2026-07-01 13:13:27 +00:00
roboomp 0ae9734708 fix(prompting): kept gpu probe output when descendants delay eof
On a probe that exits 0 with valid output but leaves a descendant holding stdout open, the bounded drain previously discarded the captured bytes and cached { gpu: null }. Use the already-captured stdout when the probe itself succeeded; only treat a non-zero/timeout exit as a failure.
2026-06-30 01:34:11 +00:00
roboomp 328e22c079 fix(prompting): bounded stdout drain on successful probes
Even on exit 0 the GPU probe can leave a descendant holding stdout open. Race the EOF wait against a 250ms grace window so the success path cancels the reader instead of blocking until the descendant exits, and unref the prep deadline timer so a one-shot CLI is not held alive by it once all prep work returns.
2026-06-30 01:09:26 +00:00
roboomp b5737a8448 fix(prompting): stopped waiting on timed-out gpu stdout
Stopped the GPU probe from awaiting stdout EOF after the probe process exits non-zero, which can hang when a wrapper leaves descendants holding stdout open. The regression now covers a killed wrapper with an inherited stdout holder and verifies the scenario process exits before the deadline.
2026-06-30 00:59:29 +00:00
roboomp fd070bf3aa fix(prompting): killed gpu probe with sigkill on timeout
Bun.spawn defaults killSignal to SIGTERM, which a wedged lspci/wmic (or its PATH wrapper) can ignore, leaving the probe alive past the prep deadline and blocking the null-cache write. Force SIGKILL so proc.exited always resolves at the deadline and the next startup hits the cache.
2026-06-29 23:33:46 +00:00
roboomp 7e7b769e45 fix(prompting): killed wedged gpu probe at the prep deadline
Replaced the Bun Shell call with Bun.spawn + timeout, so a hanging lspci/wmic now receives SIGTERM at the prep deadline instead of keeping the Bun process alive after withDeadline returned. Tightened the regression test to also assert the spawned scenario process exits within the deadline.
2026-06-29 22:54:23 +00:00
roboomp 2933f8f32c fix(prompting): bounded gpu detection
Cached empty GPU probe results and routed GPU detection through the system prompt prep deadline so slow WMI/lspci probes cannot block startup indefinitely.\n\nFixes #3835
2026-06-29 22:38:20 +00:00
can1357 ec03d3366e refactor(prompt): share prompt path normalization 2026-06-27 01:40:13 +02:00
can1357 5abe19eda1 Merge PR #3156: fix(advisor): surface nested repo context (@oldschoola)
# Conflicts:
#	packages/coding-agent/src/modes/components/status-line/component.ts
#	packages/coding-agent/src/sdk.ts
#	packages/coding-agent/src/system-prompt.ts
2026-06-27 01:40:12 +02:00
arg3t e894753603 feat(tui): add mermaid rendering toggle 2026-06-26 04:34:44 -07:00
can1357 07c910210b feat(coding-agent): allowed toggling workspace tree in system prompt
- Added `includeWorkspaceTree` configuration setting to optionally render the workspace directory tree.
- Configured the system prompt template and SDK to respect this toggle, allowing users to disable the tree to prevent prompt cache invalidation.
2026-06-21 07:03:45 +02:00
oldschoola bd3a35e13d fix(advisor): surface nested repo context 2026-06-20 15:55:47 -07:00
oldschoola ee661cb418 fix(coding-agent): handle todo paths and prompt inventory 2026-06-19 17:10:26 -07:00
can1357 a62211c586 config(coding-agent): changed default for inline tool descriptors to false
- Updated the system schema and prompt options to disable inline tool descriptors by default.
- Modified the build system prompt logic to reflect the new default fallback value.
2026-06-19 16:06:15 +02:00
can1357 45b2eb5ca8 Merge remote-tracking branch 'origin/farm/117835bc/fix-custom-system-prompt' 2026-06-19 16:06:15 +02:00
roboomp bbbd256565 fix(prompting): preserved custom prompt project footer
Render the project footer for custom system prompts while omitting context and append text already emitted by the custom prompt template.

Fixes #3014
2026-06-19 12:09:34 +00:00
roboomp b4b11232e5 fix(prompting): preserved CLI prompt precedence over SYSTEM.md
Skip the secondary loadSystemPromptFiles capability walk when the caller already controls block 0 via customPrompt/resolvedCustomPrompt, so project/user SYSTEM.md cannot silently augment a CLI --system-prompt override.

Fixes #3014
2026-06-19 12:00:46 +00:00
roboomp 21f3496976 fix(prompting): preserved resolved system prompt text
Bypass path resolution when session startup has already loaded SYSTEM.md or APPEND_SYSTEM.md contents.

Fixes #3014
2026-06-19 11:57:16 +00:00
can1357 65f0d0a245 refactor(coding-agent): renamed repeatToolDescriptions to inlineToolDescriptors
- Renamed `repeatToolDescriptions` to `inlineToolDescriptors` throughout configuration, SDK, and internal session management.
- Set the default value to `true` and updated descriptions to clarify the descriptor inlining behavior.
- Fixed the `/dump` command to prevent duplicate tool inventory output when inlining is enabled.
2026-06-19 08:05:49 +02:00
roboomp 063ce1ba00 fix(coding-agent): loaded github instruction rules
Added GitHub Copilot instruction-file discovery to the github rule provider path, mapping applyTo frontmatter into always-apply or glob-scoped rules and avoiding duplicate always-apply prompt content when context imports the same file.\n\nFixes #2731
2026-06-16 02:30:58 +00:00