Commit Graph

10249 Commits

Author SHA1 Message Date
LunarECL e7fdc99afd feat(ai): report Anthropic extra usage 2026-07-23 21:25:15 +09:00
can1357 f833810d0e fix(rpc): stream v2 chunk frames with backpressure and recover stale page cursors
Two fixes on top of the paged transport:

- Near-limit v2 framing no longer materializes the full base64 transport:
  chunk lines are generated lazily from a single serialization, the 64 MiB
  reassembly ceiling is enforced via Buffer.byteLength before any
  full-payload allocation, and RPC stdout writes drain with backpressure
  one physical line at a time. Peak RSS for a 63 MiB response drops
  ~686 MB -> ~521 MB; a rejected 80 MiB response drops ~507 MB -> ~259 MB
  (parity with the v1 path).

- get_messages_page errors now carry a machine-readable code
  (session_busy | stale_cursor). Both bundled clients' high-level
  getMessages() drains discard partial pages and fall back to the legacy
  snapshot on either code — previously a cursor invalidated by a
  background mutation (e.g. an appended bash message) threw instead of
  falling back. Direct page calls remain strict.
2026-07-23 12:38:13 +02:00
can1357 3e09e4b1ea Merge PR #6330: feat(coding-agent): add lossless paged RPC transport (@wolfiesch) 2026-07-23 12:27:38 +02:00
can1357 38efea12ed feat(coding-agent): enabled MCP Markdown result rendering by default
mcp.renderMarkdownResults now defaults to true; set false to keep raw
text. Non-JSON detection and structured JSON-tree rendering unchanged.
2026-07-23 11:54:21 +02:00
can1357 80ec1cb6ae Merge PR #6347: feat: optionally render MCP results as Markdown (@zeroknots) 2026-07-23 11:53:05 +02:00
can1357 42d705f4a7 test: use transcript-mode session context in model persistence assertions
buildSessionContext now drops failed tails by default (#6357); these
assertions inspect the interrupted tail and need transcript mode.
2026-07-23 11:49:25 +02:00
can1357 49782ecce6 Merge PR #6326: feat(coding-agent): configure isolated task apply behavior (@korri123) 2026-07-23 11:48:54 +02:00
can1357 a3687ef444 chore: removed stray node_modules symlink committed during PR integration 2026-07-23 11:40:09 +02:00
can1357 8205d3ee31 style: applied biome formatting to merged fix commits 2026-07-23 11:39:15 +02:00
can1357 ef8643547e docs: normalized changelog entries under [Unreleased] after PR merges 2026-07-23 11:37:49 +02:00
can1357 ca27ad0b06 Merge PR #4927: feat(coding-agent): rewrite /guided-goal interviewer for loop engineering (@metaphorics) 2026-07-23 11:37:14 +02:00
can1357 d109f389d8 docs(coding-agent): move format-on-write changelog entry to Unreleased 2026-07-23 11:37:13 +02:00
can1357 536d37ac07 Merge PR #5137: perf(coding-agent): avoid cold LSP startup on format-only writes (@wolfiesch) 2026-07-23 11:37:13 +02:00
can1357 db3a6a1407 Merge PR #6318: fix(tui): show fallback models in Agent Hub (@roboomp) 2026-07-23 11:37:13 +02:00
can1357 bf15acb25d fix(coding-agent): hub cancel reaches the registration behind a settled job row
A budget-aborted keep-alive subagent's job row (job id == agent id) settles
failed and is retained ~5 min; executeCancel short-circuited to
already_completed for that window, leaving the zombie registration
unkillable exactly when the user wants it dead. Fall through to
cancelAgentRegistration for settled rows; keep already_completed when no
lingering registration exists.

Also stop wiring AgentLifecycleManager.global() onto SDK sessions created
with a caller-supplied agentRegistry: the global lifecycle releases through
AgentRegistry.global(), so it would report a cancel while releasing an
unrelated global ref. Without a lifecycle, cancel falls back to
dispose + unregister on the session's own registry.

Addresses both Codex P2 review findings on #6319.
2026-07-23 11:37:13 +02:00
can1357 9756fea7af Merge PR #6319: fix(coding-agent): let hub cancel kill a jobless agent registration (@roboomp) 2026-07-23 11:37:13 +02:00
can1357 be94acbf71 fix(extensions): handle TypeScript import-equals require specifiers
Collect TSImportEqualsDeclaration/TSExternalModuleReference targets so
legacy .ts/.cts extensions using `import x = require("pkg")` get their
bare dependencies pinned like plain require() calls. Fold of the #6256
follow-up (comicchang/oh-my-pi@1e54b68) requested on #6324.
2026-07-23 11:37:12 +02:00
can1357 27fc2d60d1 Merge PR #6324: fix(extensions): resolve transitive CJS dependencies (@jeffscottward) 2026-07-23 11:37:12 +02:00
can1357 3566b78817 test(internal-urls): cover hasResolvableTranscript availability contract 2026-07-23 11:37:12 +02:00
can1357 c818e77240 Merge PR #6328: fix(task): only point follow-up hints at transcripts that exist (@paralin) 2026-07-23 11:37:12 +02:00
can1357 39c3f2a054 Merge PR #6329: fix(settings): expose Hindsight API token (@salmonumbrella) 2026-07-23 11:37:12 +02:00
can1357 c43f5d72c8 docs(coding-agent): add changelog entry for Firecrawl keyless mode (#4332) 2026-07-23 11:37:11 +02:00
can1357 bacb51dffd Merge PR #6331: Add firecrawl keyless mode support (@CoderTCY) 2026-07-23 11:37:11 +02:00
can1357 395e5ba288 fix(coding-agent): bypass anonymous-connect guard when a tool auth challenge is present
Servers may allow the unauthenticated MCP handshake yet protect individual
tool calls via _meta["mcp/www_authenticate"]. The 'reauthorization is not
required' guard would silently abort the tool-challenge reauth path.
2026-07-23 11:37:11 +02:00
can1357 7880c459b7 Merge PR #6346: fix(coding-agent): retry MCP tool auth challenges (@spenceresin8) 2026-07-23 11:37:11 +02:00
can1357 370045b310 fix(sdk): always await in-flight runtime discovery in deferred --model retry
The getDiscoverableProviders() guard skipped awaiting runtimeDiscoveryPromise
when no config-discovery providers exist, so a cold deferred selector backed
only by runtime model managers (extension fetchDynamicModels) with implicit
local discovery disabled still resolved against the offline cache. Awaiting
unconditionally is free when no runtime managers are registered
(refreshRuntimeProviders early-returns); the full refresh fallback stays
gated on discoverable providers.
2026-07-23 11:37:11 +02:00
can1357 e581452c04 Merge PR #6355: fix(rpc): await background model discovery in get_available_models, set_model, and deferred --model resolution (@ReqX) 2026-07-23 11:37:11 +02:00
can1357 e488d09751 fix(coding-agent): keep failed tails visible in read-only session history
Route loadSessionMessagesReadOnly through transcript mode (collapsed to the
latest compaction) so history:// transcripts of on-disk sessions retain
failed/aborted assistant tails that the provider-context builder now drops.
2026-07-23 11:37:10 +02:00
can1357 6fe0cc99bc Merge PR #6357: fix(coding-agent): guard session context replay tail (@honsunrise) 2026-07-23 11:37:10 +02:00
can1357 b184b22fef Merge PR #6358: feat(ai): add Synthetic usage reporting (@Gareth-Rouse) 2026-07-23 11:37:10 +02:00
can1357 ebddcc3839 Merge PR #6360: feat(task): allow per-call model selection (@panosAthDBX) 2026-07-23 11:37:10 +02:00
can1357 b4a3abe445 feat: added hasProvider method to detect known model providers
- Implemented ModelRegistry.hasProvider to return true when a provider has live models, is discoverable, or is registered at runtime.
- Replaced AgentSession's internal provider check with #isKnownProvider that delegates to the new hasProvider method, updating related fallback logic.
2026-07-23 11:17:00 +02:00
panosAthDBX bfef3f7eea fix(task): reject sparse model fallback arrays 2026-07-23 09:53:54 +01:00
panosAthDBX 10e1ba911c test(task): cover model override precedence 2026-07-23 09:50:25 +01:00
ReqX 838e37417f fix(rpc): await background model discovery in get_available_models, set_model, and deferred --model resolution
Three read paths raced background model discovery on cold start:

1. `get_available_models` RPC (rpc-mode.ts) read the registry
   synchronously and returned a partial catalog containing only
   statically-bundled models.
2. `set_model` RPC (rpc-mode.ts) read the registry synchronously and
   rejected discovery-backed selectors with "Model not found".
3. `--model <provider>/<pattern>` CLI flag deferred retry (sdk.ts:2078)
   resolved synchronously after extension registration, before
   discovery-backed providers had populated `#models`.

Paths 1 and 2 are fixed by exposing the existing in-flight background
refresh promise (`#backgroundRefresh`, already tracked and cleared by
`refreshInBackground`) via a new public
`ModelRegistry.awaitBackgroundRefresh()` method, and awaiting it at each
RPC read site. No-op when no refresh is in flight (warm sessions
unaffected).

Path 3 mirrors the cold-cache race fix already applied to the
default-role fallback on this branch (issues #6114, #6162, sdk.ts:2343):
when a deferred pattern is unresolved and any discoverable provider is
registered, run a cache-aware `refresh("online-if-uncached")` pass
before the retry. Reuses the existing discovery machinery rather than
introducing a new ordering dependency.

The `omp models` CLI never had this bug because it awaits
`modelRegistry.refresh()` directly before listing.

Behavioral characteristics:
- **Warm-session fast path preserved**: when no refresh is in flight
  (`#backgroundRefresh === undefined`), `await undefined` resolves in a
  microtask. No regression for sessions that don't need discovery or
  have already settled.
- **Failure isolation preserved**: `refreshInBackground()` already
  swallows discovery errors via `.catch(...)`, so `awaitBackgroundRefresh()`
  resolves even when discovery fails — callers then read whatever models
  made it into `#models` (built-in + cached). No new failure modes.
- **Scoped**: doesn't change `refreshInBackground()` semantics. Adds a
  new read-only awaiter with minimal API surface. Reuses the
  well-established `refresh("online-if-uncached")` pattern for the
  deferred retry path.

Reproduction (get_available_models RPC, with any discovery-backed
provider configured in `~/.omp/agent/models.yaml`):

  cd ~
  {
    sleep 1
    printf '%s\n' '{"id":"m1","type":"get_available_models"}'
    sleep 5
  } | timeout 15 omp --mode rpc-ui --approval-mode yolo 2>/dev/null \
    | grep '"id":"m1"' | jq '.data.models | {count: length, providers: ([.[].provider]|unique)}'

Before: discovery-backed provider absent from the response on cold start.
After:  discovery-backed provider present.

Reproduction (--model CLI flag, same config):

  omp --mode rpc-ui --model <discovery-provider>/<model-id> --approval-mode yolo

Before: exits 1 with "Model \"<discovery-provider>/<model-id>\" not found".
After:  starts rpc-ui session with the requested model selected.
2026-07-23 08:46:31 +00:00
panosAthDBX 1c8d9db6dd feat(task): allow per-call model selection 2026-07-23 09:42:39 +01:00
Honsun Zhu 6fae89aaea fix(coding-agent): guard session context replay tail 2026-07-23 16:38:22 +08:00
Gareth-Rouse e2839d1288 feat(ai): added Synthetic usage provider
/usage and omp usage now report Synthetic (synthetic.new) quota state
via GET /v2/quotas (free, does not consume quota): the rolling 5-hour
request limit with per-tick regeneration rate, and the weekly credit
quota in USD. Applies to API-key credentials for the synthetic
provider; every payload section is parsed defensively since only
subscription is documented.
2026-07-23 08:46:18 +01:00
zeroknots dd510f2ccc feat(coding-agent): render MCP Markdown results 2026-07-23 13:26:00 +07:00
slee1996 2145ab8f8e fix(coding-agent): retry MCP tool auth challenges 2026-07-22 23:44:38 -06:00
Christian Stewart 0ff5312744 fix(task): only point follow-up hints at transcripts that exist
The aborted-task follow-up hint always references history://<agentId>,
including when no transcript can actually be served. Following that link
then fails.

Add hasResolvableTranscript beside sessionFilesFromDisk, mirroring the
availability half of HistoryProtocolHandler's resolution semantics: a
registered ref's live session, a retained session file verified on disk,
or a disk-scanned .jsonl under a known artifacts dir (which still serves
hard-aborted children whose refs were unregistered). Probing never
throws; a stale path or unreadable artifacts subtree reads as unavailable
instead of failing delivery of the settled result. Render the transcript
clause from that check, independently of the resume affordance, so a
still-resumable idle/parked agent keeps its hub resume hint and a
disk-backed transcript keeps its link. Idle-completion hints are
unchanged.

Signed-off-by: Christian Stewart <christian@aperture.us>
2026-07-22 20:22:37 -07:00
salmonumbrella 37b81fec6e revert(hindsight): defer live runtime reconfiguration 2026-07-22 20:11:59 -07:00
salmonumbrella 4063fbd9f6 fix(hindsight): allow live backend re-enable 2026-07-22 19:55:58 -07:00
CoderTCY d115ac66c1 Fix by review 2026-07-23 10:23:06 +08:00
salmonumbrella a7f3c76428 fix(hindsight): preserve state across credential changes 2026-07-22 19:20:24 -07:00
Wolfgang Schoenberger 00a9167223 fix(rpc): accept exact-boundary v2 chunks 2026-07-22 19:13:53 -07:00
salmonumbrella dd03143b9d fix(hindsight): refresh live client on connection changes
Rebuild Hindsight runtime state when API URL or token settings change. Keep active subagent aliases routed through the latest primary state and reset bank caches across endpoint changes.
2026-07-22 19:03:24 -07:00
Wolfgang Schoenberger a0cb946057 fix(rpc): preserve v2 snapshot semantics 2026-07-22 19:00:48 -07:00
CoderTCY 1071984385 Fixes 2026-07-23 09:54:35 +08:00
CoderTCY 3ada287cb0 feat(firecrawl): support keyless mode when no API key is configured
When FIRECRAWL_API_KEY is not set, fall back to Firecrawl keyless mode
(omit Authorization header). Auto-chain still requires a credential via
isAvailable; explicit webSearch: firecrawl works keyless via
isExplicitlyAvailable returning true.

Closes https://github.com/can1357/oh-my-pi/issues/4332
2026-07-23 09:54:35 +08:00