Repository navigation
[pull] main from can1357:main - #129
Merged
Merged
Conversation
streamOllama filled prompt_eval_count/eval_count into usage but never called calculateCost, so every ollama-cloud message recorded cost 0 even though 51 bundled ollama-chat models carry nonzero cost cards. The status line segment, session transcripts, and the stats usage_history DB all stored 0, and modelOverrides.*.cost had no effect because pricing is applied by the transport. Price the terminal usage in place like every other streamer does, passing output.timestamp so timeBased schedules resolve at the request time. Fixes #13056
- RegisteredToolAdapter now hands tool renderers a second argument that answers both RenderResultOptions and the Theme API, so renderers declared renderCall(args, theme, context) — upstream pi's order, used verbatim by shipped third-party plugins — style correctly instead of throwing "theme.bold is not a function" on every tool call and falling back to the plain tool label. - Documented the dual shape in docs/extensions.md, docs/tui.md and docs/custom-tools.md, and corrected the stale renderCall(args, theme) signature in the custom-tools example README. - Added a regression test covering both argument orders. Fixes #13081
Four independent Cursor defects reported with captured wire frames. - `TurnEndedUpdate` was declared empty, so the turn's final counters decoded into `$unknown` and usage kept the `tokenDelta` estimate (22 against a real 36, with input and reasoning lost entirely). The descriptor now carries `input_tokens`, `output_tokens`, `cache_read_tokens`, `cache_write_tokens`, and `reasoning_tokens`; `applyTurnEndedUsage` adopts every bucket the frame reports and leaves the streamed estimate alone when it reports none. - `handleConversationCheckpointUpdate` returned early once a `tokenDelta` had arrived, so `tokenDetails.usedTokens` never reached `usage.contextTokens` and compaction/handoff sized the context from output tokens alone. The guard predates 66a7126, which repointed that assignment from `usage.output` to `usage.contextTokens`. - An `mcpArgs` frame with no local handler on an `externalToolExecutor` stream answered `mcpResult.success` with the handoff text while synthesizing no block, so the auth-gateway client never saw the call it was supposed to run. The call is now emitted without `kCursorExecResolved` — the marker `isClientToolUse` and the OpenAI finish-reason mapper read to distinguish a handoff from a call Cursor already ran — and its interaction frame no longer duplicates the block. - Legacy `ShellArgs`/`ShellStreamArgs.timeout` is milliseconds (`ShellTimeout.timeout_ms`, `hard_timeout`), but the bridge passed it to bash as seconds, turning a model-requested 15s into `Timeout clamped to 3600s (requested 15000s)`. Sub-second budgets round up so they cannot read as bash's "no deadline". `aiserver.v1.AiService/AvailableModels` discovery (context windows and model parameters) is not covered here: decoding it needs field numbers only a live capture can supply. Fixes #13082
- Re-exported the host Anthropic transport through the legacy pi-ai compat factory. - Covered the adapter with a real Anthropic request path regression test. Fixes #13250
- generate_image now reports the image model echoed in the hosted Responses tool config instead of the selected catalog id, and surfaces per-image size/quality from image_generation_call items. - Documented that the ChatGPT/Codex backend overrides model, size, and quality. Fixes #13403
- `LimitsApi.rotate` now returns `CredentialRotation`; when no sibling is free but one unblocks within 5 s, it sleeps (abortable) and reports `afterSiblingWait` instead of dropping `markReached`'s `retryAtMs`. - `createApiKeyResolver` and `KeyCascade.resolver` tag the post-wait resolution so the auth-retry drivers (`resolveNextAuthRetryKey`, `withOAuthAccess`) accept a bearer already sent before its short block. - SDK callers no longer get a drained account's multi-day 429 while a healthy sibling frees in under a second. Fixes #13270
Documented the embedded brush interpreter for plain tool calls and the external-shell routes selected by shellPath. Fixes #13287
Normalized absent and non-finite judgment usage before model pricing, keeping session totals finite when evaluation endpoints omit token counts. Covered missing and partial usage from successful TypeSafe responses. Fixes #13490
Prevent hidden goal steers when all open work waits on another party, including timers armed before blocking. Cover approval waits, mixed work, and resumption after input. Fixes #13494
- nix/package.nix builds pi-natives with raw cargo, so the post-link version stamp introduced in 5084d45 was never written and embed-native.ts rejected the addon. - Added a --no-sign option to scripts/stamp-native-version.ts so the Darwin nix build can stamp before signIfRequired re-signs (the sandbox has no system codesign). - Documented the Nix build as a stamp call site. Fixes #13493
Kept one 800 ms advance to assert the approval wait; later advances without an intervening turn could not exercise another scheduling decision. Fixes #13494
Base blocked-only continuation suppression on the same nextActionableTask definition used by the todo HUD, while preserving an explicit blocked-work check. Fixes #13494
Preserved local Unix-socket transport when PI_PROXY wraps global fetch. Covered the blob broker route with a real socket HTTP request. Fixes #13505
- Returned the actual prompt dispatch outcome after pre-provider cancellation. - Retried headless assignments and reminders with bounded idle waits and clear failures. - Covered dropped dispatches, recovery, and stalled idle transitions. Fixes #13538
- Cleared the forced-final latch after a dropped final reminder so a concurrent incremental yield stays incremental during retry. - Made executor test session mocks honor the prompt boolean contract. Fixes #13538
- Added a runCommands prompt option that skips extension and custom TypeScript commands while keeping file-based command and template expansion. - Disabled local commands for headless task dispatch so a false prompt result only means a dropped dispatch. Fixes #13538
- Restored prompt() resolving true for a dropped prompt, which RPC reports as aborted and hosts never treat as a local command. - Added opt-in throwOnDrop rejecting with PromptDroppedError; the task driver retries on it. - Covered the RPC prompt_result for a transition-dropped prompt and the opt-in rejection. Fixes #13538
- Allowed clippy::missing_const_for_fn on expand_windows_long_path and get_windows_short_path: on non-Windows hosts the body reduces to returning the input, but the Windows branch calls non-const pi-shell path helpers and #[napi] exports cannot be const. - Restored the bazel "Validate Rust workspace" clippy-strict step on main. Fixes #13547
…-const-fn fix(natives): allowed const-fn lint on windows path exports
…less-prompts fix(task): retried dropped headless prompts before yield
…l-continuations fix(goal): stop continuations while todos are blocked
…h-bash-scope docs(bash): clarified shellpath execution scope
…g-usage-nan fix(judgment): handled missing judge token counts
…doff-timeout fix(ai,coding-agent): recovered cursor turn usage and tool handoffs
docs(changelog): record CredentialRotation breaking change and sibling-wait fixes
…try-at-in-key-resolver fix(ai): waited out briefly blocked siblings before failing rotation
4a9a549 dropped the resolvedByExec branch as unreachable. cursor-streaming-args.test.ts still asserts a streamed MCP block whose id the exec bridge already recorded is marked resolved, and main CI fails on it. Restore the branch.
fix(ai): restore exec-resolved marking for streamed cursor MCP calls
- Removed the one-sibling-switch cap (legacyAuthSwitchUsed) from resolveNextAuthRetryKey and withOAuthAccess; 401s get one refresh-same, then walk distinct siblings bounded by cycle detection and AUTH_RETRY_MAX_ATTEMPTS. - Replaced tests pinning the cap with rotation-to-success and cycle-stop coverage for withAuth and withOAuthAccess. Fixes #13555
- Added `spawn_command` and `RunningCommand` to `Host` for non-blocking command execution. - Implemented `Jobs` manager in `xargs` to track running processes and enforce parallelism limits. - Enabled `-P`/`--max-procs` support for the `xargs` builtin to match GNU `xargs` behavior. - Added support for `-P 0` to allow unlimited concurrent command execution.
- Fixed Gemini and Antigravity responses reporting negative input tokens by clamping cache usage to prompt length and deriving input as the delta. - Corrected Cerebras model pricing to reflect that cached input tokens are billed at the full input rate. - Implemented session metadata backfilling to reconstruct header info for older session files during stats sync.
Follow-up to #13554 review. The exec bridge only records an id after synthesizeCursorExecToolCall has pushed an already-marked block, so the streamed-start guard returns before the branch runs. The removed test seeded the set without a block, which the bridge cannot produce. The exec-before-stream test now asserts the synthesized block is marked resolved.
…-test fix(ai): drop unreachable cursor exec-resolved branch and its stale test
…anup docs(changelog): note cursor MCP exec-resolution cleanup
…tation-exhaustion'
…o nested subagents - Added `inheritedSessionAgents` option to `CreateAgentSessionOptions` for passing user-authorized model agents from a parent session to its children. - Propagated `inheritedSessionAgents` through `AgentSession` construction into task executor, structured subagent, and vibe runtime configurations. - Extended `ModelMentionRegistry` to store inherited agents and include them when enumerating session agents. - Modified `sessionAgents()` to return inherited agents first, then session-tagged models, avoiding duplicate agent names. - Updated task executor options to accept `inheritedSessionAgents`, allowing child subagents to spawn inherited model agents. - Added tests confirming child sessions retain parent model agents and that structured subagents forward inherited agents.
- Implemented batched database writes to improve performance during large session-history imports. - Introduced atomic commit logic for session files and database offsets to prevent partial ingestion state. - Enabled retries for interrupted sync batches by decoupling file I/O from database transactions. - Added state management to rollback pending database rows and cursors when a batch fails.
…tion - Optimized statistics ingestion by implementing metadata pre-fetching and batched SQLite writes for session histories. - Increased batch size from 64 to 512 files, significantly reducing transaction overhead during initial imports. - Replaced serial per-file lookups with `getFileOffsets` to retrieve cursors in single batch queries. - Refactored `applySessionParseResults` to perform bulk inserts across all sessions in a batch instead of table-per-file. - Enabled pipelined file reads during inline parsing, allowing efficient processing on resource-constrained systems. - Updated fork deduplication logic to preserve parent-transcript ownership during concurrent batch processing.
…et redemption - Introduced failure cooldowns and epoch-based concurrency control in usage polling to prevent endpoint flooding during concurrent refreshes. - Added granular credential block deletion support and protected block scopes to prevent stale account-wide blocks from persisting after quota resets. - Implemented account-specific reset locking and peer reset adoption to allow concurrent Claude tasks to share confirmed resets without redundant quota spending. - Enabled Claude reset discovery to parse usage reports directly from discovery payloads, reducing dependency on secondary network requests. - Added iterative retry logic and cancellation support for reset discovery, ensuring tasks correctly handle throttled polling and transient network failures.
Normalized persisted ask arguments through live tool validation before reopening tree results. Covered null optional previews without accepting malformed saved questions. Fixes #13570
Preserved explicit file targets when legacy extensions pass a glob, while retaining directory glob scoping. Added regression coverage for both search paths. Fixes #13571
…block first in the request (@H4vC)
- Updated `ToolExecutionComponent.render` to return empty output for wait tools identified as benign skips. - Cleared the content box for such skips to prevent any rendering. - Added tests verifying skipped waits are hidden while real wait results remain visible.
- Extended the rebuild condition to detect file changes by size or modification time during replay. - Implemented logic to replace only missing or changed rows instead of deleting all records when reconciling. - Added tracking of absent messages, users, and tool calls to selectively delete stale entries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )