- Updated `irc` tool availability logic to require both `irc` settings and concurrency support.
- Imported `MAIN_AGENT_ID` and suppressed IRC access for the main agent when async mode is disabled, preventing sync-mode peer messaging.
- Pre-registered agents in the global registry before rebuilding the system prompt so peers can discover each other in initial IRC blocks.
- Replaced immediate registry replacement with attachSession to bind the live session and latest sessionFile to the pre-registered entry.
- Ensured pre-registered agents are unregistered during creation failure cleanup when no session was established.
- Replaced project, subagent, and system prompt templates to use bracket-style `[TAG]...[/TAG]` markers instead of `<|START_*|>`/`<|END_*|>` markers.
- Updated system-prompt and subagent reminder tests to assert the new bracket tag format for role, context, and contract blocks.
- Added an Unreleased changelog entry for the subagent batch registry initialization behavior.
- Replaced `===== ... =====` eval cell headers with `*** Begin ` / `*** End ` markers; legacy format remains renderable in HTML exports.
- Replaced hashline patch grammar with `*** Begin Patch` / `*** End Patch` envelope; old inputs without the envelope are still accepted.
- Extracted `sniffEvalLanguage` into a shared `sniff.ts` module reused by the parser and tool.
- Added `docs/ERRATA-GPT5-HARMONY.md` and `scripts/session-stats/harmony_backtest.py` documenting and backtesting the GPT-5 Harmony-header leak defect.
- Deleted `bash-normalize.ts` and its tests; output truncation is handled by the streaming tail buffer and artifact spillover.
- Removed `head`/`tail` schema fields from `bashSchema` and `BashToolInput`.
- Updated system prompt and bash tool prompt to forbid `| head`/`| tail` pipes and other anti-patterns, directing the agent to use dedicated tools instead.
- Expanded retry detection in the Anthropic provider to include an isRetryableError fallback after existing pattern checks.
- Imported the shared retry helper and returned true when generic retryable errors were matched.
The 50ms retry loop in #scheduleBackgroundExchangeFlush had no guard
against session teardown. If dispose() was called while streaming,
the setTimeout callbacks kept firing and attempted emitExternalEvent
on a disconnected agent.
- Add #isDisposed flag; set it at the top of dispose() before any
async teardown so poll ticks that fire mid-teardown bail out cleanly
- Clear #pendingBackgroundExchanges in dispose() to drop queued
messages that will never be rendered
- Widen the attempt() bail condition to include #isDisposed so the
loop terminates even if new messages arrived between the dispose()
clear and the next tick
new URL(...).pathname returns a POSIX-style /D:/... path on Windows, which
is not a valid filesystem path. import.meta.dir gives the correct native path
on all platforms.
- Added immutable metadata to protocol handlers and had the router copy each handler's setting onto resolved internal resources.
- Updated read and search tools to honor `resource.immutable`, and made search suppress hashline anchors only for immutable source paths while preserving them for mutable files.
- Expanded internal URL tests to cover mutable local resources and mixed immutable/mutable search input hashline behavior.
- Added explicit prompt markers and wrappers across system templates, including `[env]`, `[role]`, `[coop]`, `[closure]`, and `[now]`.
- Removed `renderTemplate` and `sectionSeparator` flows, deleted `task/template.ts`, and switched to per-task `renderSubagentUserPrompt` rendering.
- Updated system prompt assembly to `shortenPath`-normalize `cwd`, append rendered now metadata, and preserve trailing `[now]` blocks.
- Removed legacy template tests and added prompt-composition tests for ordered `[contract]`->`[project]`->`[now]` blocks and context-only system placement.
- Reworked shared prompt utilities by collapsing consecutive blank lines and removing obsolete `OPENING_HBS`/`LIST_ITEM` helper behavior.
- Removed the brace-only structural bigram helper path from the line hash logic.
- Punctuation-only lines now follow the non-significant-character path using index-seeded xxHash hashing for their hash.
- Updated the hashline line-hash comment to describe that non-significant lines use the line-number-seeded seed.
- Extended splitPathAndSel to detect compound selectors that combine a line range with `raw` in either order.
- Updated read selector parsing to support `:lines:raw` and `:raw:lines` selectors and propagate raw-mode handling through internal URL, archive, and notebook paths.
- Added tests covering compound selector syntax and confirming it returns verbatim content without anchors or line-number prefixes.
- Added a collapsible tools header with chips and intent metadata styles in HTML exports.
- Added eval tool support with cell-level parsing and inferred language syntax highlighting.
- Added dedicated renderers for search, recipe, and irc tool calls and separated `_i` intent from tool args.
- Enhanced edit, ast_edit, find, search, and gh renderers with richer headers, fields, and option badges.
- Changed power-assertion state so assertions were prompt-scoped and no longer blocked after aborts.
- Extended file-display resolution to accept an immutable flag and suppress hashline anchors when immutable sources are requested.
- Plumbed immutable propagation through ReadTool and SearchTool so internal URL reads and searches pass that context.
- Added a regression test confirming artifact:// search output no longer includes hashline anchors.
- Added macOS power assertion settings for idle, system, user, and display with schema defaults.
- Added idle, system, and user options to MacOSPowerAssertionOptions in TS typings and Rust, preserving display.
- Changed agent-session power flow to use begin/end/reset in-flight helpers and avoid manual counter updates.
- Updated power assertions to combine multiple kinds per native handle and support safe repeated-stop behavior.
- Updated unreleased changelog notes to document the breaking behavior and canceled-prompt unblock correction.
- Added `listWorkspace` native binding and API types, exporting bounded workspace trees with AGENTS.md candidates.
- Reworked `buildWorkspaceTree` and `buildDirectoryTree` to call `listWorkspace` with 5s timeout defaults.
- Replaced startup AGENTS.md discovery with workspace-tree-only scanning and removed legacy AgentsMdSearch session plumbing.
- Updated `WorkspaceTree` and system prompt context to expose `agentsMdFiles` and aligned tests/changelog expectations.
- Dropped the `modify` edit type and its `< ANCHORTEXT` / `+ ANCHORTEXT` syntax.
- Removed associated parser rules, regex patterns, apply logic, and tests.
- Deleted the "Append WITHIN a line" example from the prompt docs.
- Added a 30s timeout for extension handlers in runner.ts so stalled callbacks now emit warnings and stop.
- Consolidated duplicated extension handler error handling by routing calls through #runHandlerWithTimeout.
- Introduced a flag to detect when an explicit modelRegistry was supplied to runSubprocess.
- Skipped modelRegistry.refresh() when reusing the parent registry and retained refresh when creating a new one.
- Added a debug log to indicate when a parent modelRegistry is reused and refresh is bypassed.
- Refactored SSE response parsing to read the stream with a single in-progress drain loop.
- Resolved the matching request promise when the expected JSON-RPC result or error arrives and continued dispatching remaining SSE messages on the same stream.
- Adjusted error handling to reject on abort/timeout or missing response and clear the timeout when stream parsing completes.
- Updated task call rendering to use `args.tasks?.length ?? 0` when displaying agent counts.
- Prevented runtime warnings in streaming task calls when the `tasks` array was still undefined.
- Updated the hashline prompt to clarify that anchors must use the file state from the most recent read.
- Added guidance warning not to renumber line references when stacking multiple patch operations.
- Anthropic streaming now populated output.errorMessage from refusal stop_details, including category and explanation when available.
- Stream handlers for Bedrock, Azure OpenAI, Google, Google Vertex, Google Gemini CLI, and OpenAI now threw output.errorMessage when stopReason indicated aborted or error instead of a generic unknown message.
Reporter screenshot showed a parent session on DeepSeek V4 Pro dispatching
a task subagent that resolved to `qwen3.6-plus-free` — an opencode-zen
model the user had no working credentials for. The dispatch hit a
provider that could not serve the model and surfaced a confusing API
rejection instead of using the parent's already-authenticated model.
Adds `resolveModelOverrideWithAuthFallback`, an auth-aware wrapper
around `resolveModelOverride` that checks the resolved subagent model's
credentials via `modelRegistry.getApiKey` + `isAuthenticated` and
falls back to the parent session's active model pattern when the
primary has no working auth. The parent's active model is plumbed
through `ExecutorOptions.parentActiveModelPattern` from `TaskTool`
into `runSubprocess`. If neither has working auth (or they resolve to
the same model), the primary resolution is preserved so the existing
error path still surfaces a meaningful failure downstream.
Fixes#985
- Model resolver: provider-prefixed `<provider>/<id>` selectors are now
strict. If the provider is known and the exact pair does not resolve,
return undefined instead of silently crossing provider boundaries
(e.g. routing `anthropic/claude-3-7-sonnet` to amazon-bedrock when
the user only has Anthropic auth). Unqualified resolution is unchanged.
- Compaction: when the current model's provider has no credentials,
manual compaction now retries across compaction model candidates and
falls back to an authenticated role; if no usable fallback exists, it
throws a clear provider-specific pre-stream error instead of bubbling
a 503 `auth_unavailable` from the provider stream.
Fixes#986Fixes#980
- Image blocks sent to models without vision support now emit `[image omitted: model does not support vision]` instead of being silently dropped, preventing opaque 404 errors.
- Fix applies to user messages and tool-result payloads across Anthropic, OpenAI completions/responses, Codex, and Google providers.
- Extracted shared `vision-guard.ts` with `partitionVisionContent`, `joinTextWithImagePlaceholder`, and `NON_VISION_IMAGE_PLACEHOLDER`.
- Added regression tests covering all five provider paths.
Fixes#967Fixes#968
- Trim logo from 14w to 12w (2-wide legs).
- Diagonal BL→TR gradient instead of per-line LTR.
- Truecolor: 3-stop magenta→violet→cyan path that skips the deep-blue valley.
- 256-color: same 6-stop ramp as fallback.
- Compute the colored logo once at module load instead of per render.
Adds an opt-in onSseEvent callback across HTTP-streaming providers (Anthropic, OpenAI Responses/Completions, Azure OpenAI Responses, OpenAI Codex SSE, Google Gemini CLI, GitLab Duo, Kimi, Synthetic) so callers can inspect raw SSE frames without altering parsed output. Provider fetch wrapping only tees response bodies when an observer is wired; standalone packages/ai consumers without onSseEvent are not penalized.
Adds streamIdleTimeoutMs (env: PI_STREAM_IDLE_TIMEOUT_MS, with PI_OPENAI_STREAM_IDLE_TIMEOUT_MS as a backward-compatible alias). Anthropic now enforces a steady-state idle watchdog (default 120s) in addition to the first-event watchdog. OpenAI Responses, Azure Responses, and Codex (SSE + WebSocket) gain a semantic-progress predicate so response.in_progress-style keepalives no longer keep stalled tool calls alive forever.
Adds a coding-agent debug-panel raw SSE viewer backed by a per-session bounded buffer (1000 records / 512KB) that AgentSession populates unconditionally so users can post-hoc inspect a stuck stream from the TUI.
- Updated the hashline grammar to require a full `LID .. LID` range for block operations.
- Enhanced `parseRange` to reject single-anchor syntax and malformed ranges, and to require duplicated anchors for one-line edits.
- Reworked hashline prompt examples/tests accordingly and added coverage for single-anchor delete/replace forms.
Adds an optional onCredentialDisabled callback to AuthStorage so callers
can react when a credential is soft-disabled (e.g. OAuth refresh fails
with invalid_grant). Handler exceptions are caught and logged so the
disable path always completes.
Includes tests covering: definitive refresh failures fire the event,
transient failures don't, and a throwing handler still lets the
credential get disabled.
Co-Authored-By: omp <noreply@oh-my-pi.dev>
- Replaced regex-based import rewriting in `rewriteStaticImports` with Babel AST parsing.
- Handled default, namespace, named, and side-effect imports, preserving `import ... with` options.
- Returned original source on no top-level imports, parse failures, or unchanged non-import regions.
- Added `@babel/parser` dependency and tests/changelog coverage for top-level static-import rewrite behavior.
- Added `./hashline` package exports and redirected callers to the new hashline entrypoint.
- Moved hashline logic out of `edit/` to `src/hashline` and removed `edit/modes/hashline`/`edit/line-hash` paths.
- Added hashline parsers, anchors, types, and diff helpers with stricter input and mismatch validation.
- Implemented preflight and cache-recovery execution flows to reapply edits and handle stale anchor mismatches.
- Documented the hashline API relocation as breaking changes in `CHANGELOG.md`.
- Clarified the hashline guidance to select a self-contained syntactic unit before narrowing the edit operation.
- Added a multiline destructuring/call example showing the full construct replacement pattern and safer alternatives.
- Updated anti-pattern instructions to reject partial-boundary replacement payloads and continuation-fragment edits.
- Removed hashline anchor auto-rebase logic, including the ±5-line rebase window and `tryRebaseAnchor` fallback.
- Validation now reports hash mismatches directly as hard `HashMismatch` entries and surfaces them via `HashlineMismatchError` without mutating anchor lines.
- Updated the changelog to document anchor auto-rebase removal and the immediate re-read recovery behavior.