sync: upstream v0.83.0 - #513
Open
code-yeongyu wants to merge 71 commits into
Open
Conversation
Route claude-opus-5 through the Anthropic Messages API with adaptive thinking, the Copilot minimal thinking-level override, and pin the extended 1M context window alongside the other Copilot Opus models.
* feat(ai): expose pending streaming stop reason Closes #7142 * manual tidy up of human facing copy
…(#7114) The OpenRouter PKCE flow only completed through the loopback callback server, so remote/headless sessions (e.g. pi over SSH) could never finish login: the browser runs on another machine and cannot reach 127.0.0.1 on the host running pi. Race the callback server against a manual_code prompt, matching the existing Anthropic and OpenAI Codex flows. Users can paste the final redirect URL (or the bare authorization code) and the flow exchanges it with the same PKCE verifier. A claimed callback keeps priority so a pasted code cannot interrupt an in-flight exchange. The callback server object follows the OAuthServerInfo shape from the OpenAI Codex flow: waitForCredential() resolves null when cancelWait() hands the login over to manual entry, and close() is pure cleanup that never settles the wait. Refs #7078
feat(coding-agent): add extension creation eval
Full design for the durable, resumable harness: session log with harness entries, SessionTree query contract, public API with result unions, watch() snapshots, events/hooks catalogs, recovery procedures as code, forks, storage backends, and telemetry integration.
Extensions have no way to read the session's scoped model set (the models
resolved from --models / enabledModels against the available catalogue --
the same list /scoped-models shows). The only model surfaces on
ExtensionContext are ctx.model (active) and ctx.modelRegistry.getAvailable()
(the whole catalogue, unfiltered), so an extension that wants a scoped
model picker must either enumerate everything or re-implement pi's scope
resolution (minimatch on provider/modelId / bare modelId + enabledModels +
--models) from disk -- duplicating core logic.
Add ctx.scopedModels: readonly ScopedModel[] to ExtensionContext, mirroring
how ctx.model is exposed (field -> bindCore -> lazy getter in createContext()).
Empty when no scoping is configured (all available models usable). Each entry
is { model, thinkingLevel? }.
- types.ts: ExtensionContext.scopedModels + ExtensionContextActions.getScopedModels
- runner.ts: field, bindCore wiring, lazy scopedModels getter
- agent-session.ts: provide getScopedModels: () => this._scopedModels
- test: assert ctx.scopedModels reflects the action (default [] + live ref)
- docs/extensions.md: document the new field
Co-authored-by: ngSoftware <alessandro@pungitore.ch>
Bedrock profile configured via pi's auth flow was ignored when ambient AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY were set, because pi forced config.credentials from those keys and the SDK treats explicit credentials as overriding config.profile. Fixes #6957
…ome directory (#7167) * fix(coding-agent): isolate autoload-disabled package test from real home directory The test asserted result.skills is exactly empty, but resolve() also scans ~/.agents/skills via getHomeDir(). On machines where that directory is populated the test failed; CI runners have no ~/.agents/skills, so it always passed there. Stub HOME to the temp dir with the same save/restore pattern used by neighbouring tests. * fix(coding-agent): use vi.stubEnv for home directory isolation Replaces the manual try/finally save/restore with vi.stubEnv plus vi.unstubAllEnvs in afterEach, shrinking the fix to two added lines. * fix(coding-agent): plant decoy user skill so the empty-skills assertion cannot pass vacuously With an empty sandbox, result.skills equal to [] could not distinguish the package skill being correctly excluded from skill resolution being broken entirely. A decoy skill in the stubbed HOME's .agents/skills proves scanning still works while the package skill stays excluded. * fix(coding-agent): simplify home isolation test
…e reloads (#7218) fixes #6968
* fix: rpc bash no longer bypass user_bash * fix: rpc bash no longer bypass user_bash
Image.render() previously emitted the imageFallback line without truncateToWidth. Long absolute paths (common when callers pass a filename) exceeded the terminal width and crashed the TUI. - imageFallback: home-shorten paths to ~/...; OSC 8 file:// link when hyperlinks are available and the path is absolute - Image.render: truncate fallback lines to the render width - tests for shorten, hyperlink, basename, and width clamp Co-authored-by: Moritz Hofmann <Moritz.Hofmann@aimentum.de>
Bump TypeBox to 1.3.7 so compiled validators guard array-specific keywords when null is accepted, and cover tool-argument validation with a regression test. Breaking for extensions: TypeBox 1.3 removes deprecated APIs including Type.Base, Type.Awaited, Type.Promise, Type.AsyncIterator, Type.Iterator, Type.Options, and Value.Mutate. Extensions using these through Pi's bundled TypeBox aliases must migrate to supported TypeBox APIs. Fixes #7003
…es (#7221) Running from a linked worktree nested under its main repo loaded the project's AGENTS.md/CLAUDE.md twice. The ancestor walk climbs from cwd to the filesystem root, so it picked up the worktree's copy and then the main repo's copy above it, even though both are the same tracked file. The walk now drops that one duplicate: the main repo root's copy is skipped when the worktree root has a context file of the same name. Nothing else changes. The worktree still inherits the main repo's copy when it has none, directories above the main repo keep loading, and ordinary repos, sibling worktrees, submodules and bare layouts are untouched.
Treat unmapped Mistral finish reasons as provider errors instead of successful stops.
Restructured rewrite: concepts (session = tree + lanes + per-lane operation logs + global facts), records and crash-site traces, recovery as reduction, then API and implementation top-down. Renames refs to lanes, generations to tasks; retires leaf entries, de-trees labels and name, adds deferred provider requests (stopReason deferred, optional fetchDeferred/cancelDeferred on ProviderStreams, deliberate lane suspension), SQLite branch cache with tips and reverse lookup, Unix ms timestamps. Supersedes harness.md.
fixes #6998 #6951
Shows file-backed SYSTEM.md and APPEND_SYSTEM.md entries in the interactive startup [Context] section. fixes #7096
…eason Adds AssistantMessage.rawStopReason and preserves provider original stop reasons. Improves certain cases of error messages. For mistral, change unmapped finish reasons to be "error" instead of "stop". fixes #7255
Prefer function payloads when malformed OpenAI-compatible tool-call deltas also include an empty custom object, preserving parsed arguments. Fixes #7160 Co-authored-by: Sunny Young <isunnyyoung@gmail.com>
Owner
Author
QA evidence
Evidence files captured before this PR was opened:
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Automated upstream sync for
v0.83.0.71efc6f0c1909874ec8c944637a9ae7fc0e2d508upstream-agent-qa-v0.83.0QA completed before PR creation:
npm run buildnpm run checknpm testsenpi-qacommon, mock-loop, CLI smoke, and tmux TUI smoke when availableSummary by cubic
Sync to upstream v0.83.0. Adds streaming “pending” stop reason, per-request fetch injection, Copilot Claude Opus 5, headless OpenRouter login, and new credential export commands, plus multiple provider and session stability fixes.
New Features
fetchinjection for supported providers; Google adapters explicitly reject custom fetch.senpi auth print-api-keyandsenpi auth print-bearer-token; exposectx.scopedModelsto extensions; show SYSTEM/APPEND system prompt files in the startup context; enable usage in streaming for llama.cpp.Migration
Type.Base,Type.Promise,Type.Options) were removed. Update extensions to supported TypeBox APIs.done; treat a terminal "pending" as an error.Written for commit 57a167f. Summary will update on new commits.