Skip to content

chore: isolated merge preview for upstream b6c10c6 (PR #814) - #2

Closed
yuxino wants to merge 51 commits into
febug:codex/pr814-merge-preview-b6c10c6from
vastsa:main
Closed

yuxino wants to merge 51 commits into
febug:codex/pr814-merge-preview-b6c10c6from
vastsa:main

Conversation

@yuxino

@yuxino yuxino commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Completed isolated merge preview for vastsa#814.

The original PR branch was updated non-destructively to 212debf, integrating upstream main b6c10c6. The only manual conflict was packages/shared/src/index.ts; both the upstream header-value export and the PR's pi-skill-discovery export were preserved. All remaining files merged automatically.

Compared with upstream main, the original 30-file scope and +791/-8 totals are unchanged. Input blob hashes, single-file three-way conflict reproduction, export preservation, duplicate module exports, conflict markers, and Node TypeScript syntax checks passed. Full build/typecheck/runtime tests were not run in this environment; CI remains authoritative for integration validation.

This helper targeted only an isolated scratch branch. Neither this draft nor the upstream PR was merged into main. Scratch commits are not in the original PR branch history.

yuxino and others added 30 commits September 21, 2026 22:34
Avoid carrying a scroll offset between unrelated settings categories.
Reset on destination changes before search anchors run, while retaining
the position on same-category updates and repeated selection.

Closes #812
Merge the current upstream main so the settings scroll change remains
reviewable alongside recent fixes. Preserve both sets of English and
Chinese E2E scenarios without changing the original implementation.
Keep the settings scroll PR current with the merged queue admission fix.
Retain both acceptance scenarios and their original implementations
without rewriting the shared branch history.
Keep the shared PR current with upstream main while preserving its
settings navigation behavior and the contributor's commit history.
Validate the combined candidate before updating the existing PR.
Keep the shared PR current with configuration sync and runtime updates
without changing its settings navigation behavior or rewriting history.
Include the new WebDAV compatibility work before candidate validation.
Preserve the original PR behavior and both upstream and author history.
Custom proxy providers and gateway aggregators frequently route models
through channel path prefixes (such as proxy/claude-opus-4.6, custom/...,
relay/..., or gateway-01/...), dash/dot prefixes (such as
myproxy-claude-opus-4.6), endpoint aliases (such as -agent, -latest),
or append reasoning effort suffixes (such as -thinking, -think, -high,
-low, :thinking).

Previously, modelsDevCatalog lookup and modelIdsMatch only stripped
known vendor prefixes and @region tags, causing proxy-prefixed,
endpoint-aliased, or effort-suffixed model IDs to miss catalog entries.
As a result, the UI could not detect thinking support, reasoning effort
options, context windows, or model metadata for proxy providers.

This commit:
- Enhances modelIdsMatch in @pi-desktop/shared to strip reasoning
  effort suffixes and endpoint suffixes (-agent, -latest) while guarding
  against matching conflicting known vendor families.
- Adds isProxyPrefix() to support dynamic proxy prefixes while
  preserving legitimate model tiers like -fast, -mini, and -medium.
- Expands registrationKeys and adds lookupCandidateKeys in
  ModelsDevLookupIndex so catalog lookups efficiently resolve
  proxy-routed, endpoint-aliased, and thinking-suffixed model IDs
  without full catalog scans.
- Adds comprehensive unit tests covering generic proxy paths, prefixes,
  effort suffixes, endpoint aliases, tier exclusions, and catalog lookups.
A gateway that re-serializes provider events with `omitempty` (Go) or
drops `undefined` (JS) sends a text, thinking, or tool-call delta
without its string field. The assistant message frame encoder read
`.length` off that missing value and threw a bare TypeError, which the
runtime classified as a retriable `PROVIDER_ERROR` — no HTTP status and
no network cause — so it consumed the shared ten-attempt budget and then
showed the V8 text to the user. The trigger is a property of one relay
plus one conversation, so the turn failed identically every time, a fork
inherited it, and a new session was clean (issue #883).

The encoder now reads a non-string payload as the empty string, the only
value a dropped field can have been. The two stream decoders that leaked
the missing value — `anthropic-messages` (text, thinking, input_json,
signature) and `openai-responses-shared` (text, thinking, reasoning
summary, tool arguments) — stop passing it through, so a dropped field
can no longer corrupt accumulated text into the literal "undefined".
`openai-completions` already guarded the same field.

The regression test drives the real decoders through a stubbed transport
and feeds every event through the real encoder; on the unpatched
dependency it fails with the reported TypeError.

fixes #883
fix(agent-runtime): ignore a stream delta that omits its string field
The hero was a single-session screenshot. Replace it with the new
mockup that shows one session orchestrating three subagents next to
the work-panel browser, so the first image matches the capability the
README leads with.

Both README.md and README.zh-CN.md reference the same asset, so the
hero updates in both languages without further edits.
docs(readme): use the multi-agent mockup as the README hero image
The previous docs homepage used a generic blue marketing theme and a
synthetic CSS console instead of product imagery, which undercut trust
and looked unfinished on mobile. Align the site with the Codex charcoal
product system, put a real workspace screenshot in the hero, and add a
tour gallery so readers can see the product before diving into specs.

Also cancel VitePress's negative hero margin so the mobile nav no longer
collides with the first-level heading, and drop remote font loading in
favor of the system stack used by the desktop shell.
docs(site): redesign the documentation site around real product UI
Use the exported 2560x1440 WebP the maintainer supplied instead of the
re-encoded image from #889. It is committed byte-for-byte as exported,
so the hero keeps the original rendering and drops from 452 KB to
128 KB.

README.md and README.zh-CN.md share this asset, so both heroes update
without Markdown changes.
docs(readme): swap the README hero for the shots.so mockup
The laptop mockup added visual chrome that competed with the product UI.
Use the direct full-window screenshot instead so the hero reads as the
real workspace at a glance, and keep the asset web-sized.
docs(site): swap the homepage hero to the unframed workspace shot
The previous landing stacked bordered cards and dense grids, which read
as internal documentation chrome instead of a product introduction.
Recompose the homepage around a black canvas, extreme display type, and
the transparent README hero still with product screenshots as cinematic
story beats.

Images come from docs/image/readme so the docs site and repository
front matter stay visually aligned. Local-first and get-started copy
follow the README narrative.
docs(site): rebuild the landing page in a keynote register
The Models page kept a checked image model after every image checkbox
on its provider was cleared, and still showed the row when no candidate
could be chosen. Hide that row when nothing is selectable, and leave
the default unchecked instead of adopting another provider.
fix(settings): clear the image model when nothing remains selectable
Global search scrolled after paint, so a category change flashed the top.
A plugin destination also stayed open because setSettingsTab only updated
the built-in tab.
…ale credentials

A nested remote directory failed because only the leaf collection was
created, and a saved WebDAV password was reused after the endpoint or
account changed. Saving settings also cleared an existing pause.

Create missing collections under the selected endpoint, bind the stored
password to that endpoint and account, keep a pause across saves, and
show a recovery action for host error codes.
fix(config-sync): recover WebDAV setup from nested directories and stale credentials
…equest

A provider's custom header value holding a fullwidth character made undici
throw `TypeError: Cannot convert argument to a ByteString ... greater than
255` before the request left: the value reached `Headers.set`, which takes a
ByteString. The report was `0` (U+FF10) at index 7. Only rows created after
custom headers shipped (v0.14.0) could show it, so the same configuration
looked healthy on an older build.

- `packages/shared/src/header-value.ts` folds the fullwidth block
  (U+FF01–U+FF5E) and the ideographic space (U+3000) onto ASCII, then trims,
  then requires HTAB, printable ASCII or the Latin-1 supplement. A full NFKC
  pass is deliberately not used: it rewrites halfwidth katakana into U+30A2
  plus combining marks, which still cannot travel. One rule, two engines —
  `crates/host-core/src/providers/validation.rs` mirrors it, and both count
  the reported index in the units undici names.
- The three boundaries fail differently on purpose. The editor's save refuses
  an unusable row with `HEADERS_INVALID` naming the character and its index;
  a stored map folds on read and drops what cannot travel, so a store written
  before the rule cannot fail a turn; a sync bundle is folded and dropped
  before it is deserialized (`retain_storable_headers`), so a row a peer on an
  older build still carries cannot fail a whole revision. `config_headers` and
  the new helper share one implementation.
- Provider API keys fold on both sides (a key is signed into `Authorization`
  or `x-api-key`) but are not refused at save, because some auth kinds do not
  put the key in a header.
- The Advanced editor says next to the rows when a value will be folded and
  when it will be refused, and only for rows that will actually be persisted.

Verification: cargo test -p host-core 637 passed; packages/shared 968 passed;
packages/agent-runtime 958 passed; packages/i18n 25 passed; apps/desktop
2625 passed and `tsc --noEmit` clean; docs check:locales (80 pairs) and
check:docs (508 pages); check:pr-base. E2E-005G carries the packaged journey
and stays Documented, not run.

Specs: `03-runtime/12-provider-config-schema.md` (§headers, §validation),
ADR 0178, decisions log D619, E2E-005G.
D619 is already the copied-formula decision on main, so this record
takes the next free id. rustfmt the lines the fold added.
fix(providers): fold fullwidth header values instead of failing the request
A wrong backup password was wrapped as "unlock vault", so the settings
page treated it as an unknown failure instead of asking for the vault
password.
fix(config-sync): keep the vault-password error code visible
vastsa and others added 21 commits September 23, 2026 02:32
TypeBox 1.x omits `required` altogether when no property is required, and
Read, Glob, Grep, and BrowserPreview declare their canonical argument as
optional so the `file_path` / `query` alias spelling validates too. The
OpenAI chat/completions adapter forwards `parameters` verbatim — only the
Anthropic adapter fills `required ?? []` — so a relay that decodes the
missing key into a nil slice answered `Invalid schema for function 'Read':
null is not of type "array"` (#864).

Normalise the schema where the tool catalogue is built, because that is the
single origin of every tool: the session agent and a delegated Task run then
send the same declaration. An absent `required` already means "nothing is
required", so writing `[]` states the same contract explicitly and changes
no tool's accepted arguments.
The 0.86.1 patch taught convertMessages to fill a documented placeholder
when a DeepSeek-family relay rejects an empty reasoning echo, but pi-ai
rebuilds compat from an explicit allowlist in getCompat. The flag that
provider-binding puts on a relayed DeepSeek model never reached the adapter,
so the fill silently degraded to "" and the relay rejected the request with
`The reasoning_content in the thinking mode must be passed back to the API`
(#864).

Pass the opt-in through getCompat and declare it on OpenAICompletionsCompat.
No endpoint can be auto-detected as requiring a non-empty echo, so
detectCompat reports it as undefined and only an explicit model.compat
opt-in enables it.

fixes #864
fix: send valid tool schemas and non-empty reasoning replay to OpenAI-compatible relays
A pinned pi-ai catalog hides models the signed-in account already
serves. Each vendor now reads its own model list, and the pin is used
only when that request fails.
fix(oauth): load vendor account models from each vendor
Keep the runtime aligned with the upstream release while preserving local
adapter fixes and guarding native session writes from context edits.
chore(agent-runtime): sync Pi SDK to 0.87.0
Mark the Cloud sync destination as experimental and expose it only when developer mode is enabled. Keep its rail, search, and page behavior aligned, with the isolated Settings E2E covering the visibility gate and fallback.
Keep the Remote Hosts guard aligned with the shared navigation metadata used for experimental badges. Verify both visible badge paths so the test protects the user-facing contract instead of a removed ID-specific branch.
feat(settings): gate cloud sync behind developer mode
A launch failure before any message is stored left an error-only assistant
row that the empty home treated as no transcript, so the chat page went
blank. Keep that row visible, and name a vendor-account model the account
list did not return.
The thinking-only empty-home guard moved into chat-launch-error.ts.
Point the source contract at that helper and at the ChatSurface call.
fix(chat): show why a vendor session cannot launch
Keep the chat tree mounted while Settings is visible so returning to a conversation does not re-trigger the renderer assertion. Reload the live app window after an unexpected renderer exit to recover from a black screen.

fixes #897
Custom proxy providers and gateway aggregators frequently route models
through channel path prefixes (such as proxy/claude-opus-4.6, custom/...,
relay/..., or gateway-01/...), dash/dot prefixes (such as
myproxy-claude-opus-4.6), endpoint aliases (such as -agent, -latest),
or append reasoning effort suffixes (such as -thinking, -think, -high,
-low, :thinking).

Previously, modelsDevCatalog lookup and modelIdsMatch only stripped
known vendor prefixes and @region tags, causing proxy-prefixed,
endpoint-aliased, or effort-suffixed model IDs to miss catalog entries.
As a result, the UI could not detect thinking support, reasoning effort
options, context windows, or model metadata for proxy providers.

This commit:
- Enhances modelIdsMatch in @pi-desktop/shared to strip reasoning
  effort suffixes and endpoint suffixes (-agent, -latest) while guarding
  against matching conflicting known vendor families.
- Adds isProxyPrefix() to support dynamic proxy prefixes while
  preserving legitimate model tiers like -fast, -mini, and -medium.
- Expands registrationKeys and adds lookupCandidateKeys in
  ModelsDevLookupIndex so catalog lookups efficiently resolve
  proxy-routed, endpoint-aliased, and thinking-suffixed model IDs
  without full catalog scans.
- Adds comprehensive unit tests covering generic proxy paths, prefixes,
  effort suffixes, endpoint aliases, tier exclusions, and catalog lookups.
Keep configured model binding identities strict while resolving narrowly defined routed and suffix aliases only for models.dev enrichment. Scope catalog capabilities to the selected provider and disambiguate shared or recognized API endpoints.

Record the lookup boundary in the English and Chinese specifications, repair the existing E2E locale table mismatch, and cover the previously reported false matches and endpoint collisions.
Keep the reviewed catalog fix as the complete tree while retaining the closed pull request head as a parent so GitHub can reopen the same discussion.
Keep the Chinese E2E traceability matrix aligned with the renderer crash recovery scenario introduced on main. This restores the locale and documentation CI gates without changing runtime behavior.
fix(docs): sync Chinese E2E traceability
Resolve the localized E2E traceability wording conflict while preserving the catalog alias implementation and the latest main documentation state.
…atching

fix(catalog): scope proxy model aliases to metadata only
@yuxino yuxino closed this Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants