Repository navigation
revert(gateway): fully revert #2630 upstream target binding - #2920
Conversation
Reverts 0237a47. Preserve subsequent Scope documentation, Codex outcome guidance, and the current persistence digest; adapt Dify references to the restored configuration contract.
NeverENG
left a comment
There was a problem hiding this comment.
I reviewed this revert against both the pre-#2630 parent and current master. I did not find a compile-level or dangling-reference problem: the persistence digest is preserved, the Core target-resolution endpoint predates #2630, deleted test references are cleaned up, and most CI is green.
The inline comments cover the concrete issues I found. One additional risk is worth making explicit: this is a security-boundary rollback (separate API/Core credentials, Core-token bearer validation, target/model mismatch guard, and stricter endpoint validation). That is expected for a revert, but it should be a conscious release/security decision rather than only a code revert.
check-website is currently red because of an unrelated next/font Google Fonts loader error (TypeError: Cannot read properties of null (reading '1') in src/app/fonts.ts); gateway-validation / check is still pending at the time of this review.
Keep the later master persistence rationale that the #2630 revert dropped, restore the supervisor usage flush/timeout stabilization, and continue running the remaining real Gateway listener acceptance tests. Also keep gateway path selection in sync with the restored listener suites.
Adapt later per-Scope authorization guidance to the restored pre-#2630 gateway model instead of dropping it with the target-binding revert. Keep the native migration test reading the reviewed target revision and verifying the stored schema revision.
623d668 to
d99ce8d
Compare
|
Coordination note: #2925 restores every configuration that works on the v1.6.0 release — legacy
With #2925 in place this full revert no longer has a compatibility gap to close, while it would drop the #2460 P0 guarantees and the real-listener A/B acceptance that already pass. Suggest narrowing this PR to the items still considered necessary — I do not see any that are required for 1.6.0 parity — or closing it. If both land anyway, the overlap is in |
|
Re-reviewed The remaining issue is the existing team-installation finding. I independently confirmed that appending the callback credentials invalidates the environment-file identity recorded at installation, while the loaded configuration still lacks those headers. This was a loader-boundary reproduction, not an installed-service test. Please restore validation and service reinstallation after writing the callback credentials in both locales, or write the complete configuration before the initial installation. I am referencing that thread rather than opening a duplicate. |
frf12
left a comment
There was a problem hiding this comment.
Reviewed ce622a7. The installation finding is resolved in both locales: callback credentials are written before configuration validation and the appropriate service refresh. Shell-command, configuration-readback and controller identity-refresh checks passed using a fake native manager; no installed service was restarted. The retained direct Core RPC transport and endpoint validation were also reviewed. The overflow-evidence wording remains a non-blocking documentation follow-up. Current-head CI is still running and must pass before merge.
oceanbase#2920 reverted oceanbase#2630, so the gateway again reaches the upstream through PC_GATEWAY_UPSTREAM_URL_RESPONSES, Core's target comes from PC_GATEWAY_UPSTREAM_PROFILE, and no gateway.user grant or enforced access mode is required. Align the DSH guide (en and zh) with that setup and link the restored Gateway authentication boundaries section.
…cope-header Resolve pi.md (en/zh) and the Pi gateway e2e on oceanbase#2920's restored gateway setup: the gateway reaches the provider through PC_GATEWAY_UPSTREAM_URL_RESPONSES, its Core credential is granted server.observer and scope.contributor, and the e2e no longer grants gateway.user.
Resolve opencode.md (en/zh) in favor of master's restored gateway target paragraph from oceanbase#2920.
oceanbase#2920 reverted the Core target contract. The guide and the gateway e2e return to master's setup: PC_GATEWAY_UPSTREAM_URL_RESPONSES with PC_GATEWAY_UPSTREAM_PROFILE, PC_GATEWAY_API_KEY on non-loopback listeners, and, when Core enforces authentication, server.observer and scope.contributor for the gateway's Core identity on every Scope a request selects.
* feat(dsh): let the gateway own prompt-time context Add POWERCONTEXT_DSH_PROMPT_RECALL (patch key promptRecall, default true). With it off, the pre-step hook prepares and appends nothing, the companion memory service is not provided, and agent-loop model requests carry X-PowerContext-Conversation-ID through llm-pi-ai/request-headers. Document routing DSH 0.2.2 through the gateway's Responses route. * docs(dsh): note that the gateway captures DSH session-title requests A real DSH 0.2.2-rc.5 run behind the gateway with PC_GATEWAY_SEDIMENT=on stored each session-title request as a gateway turn of its inferred conversation, with the title prompt as the user text. * docs(dsh): name the DSH versions that cannot send the conversation header The llm-pi-ai/request-headers hook is already in dsh-llm-pi-ai 0.2.2-alpha.3 and absent in 0.2.1-rc.5 and 0.2.0-rc.2. * feat(dsh): mark DSH's internal model requests for the gateway While prompt recall is off, requests that DSH sends with a purpose (compaction, session titles, auto review) carry X-PowerContext-Turn: internal instead of no header, so the gateway neither injects context into them nor captures them as turns. The guide now says so, and states that the plugin does not send X-PowerContext-Scope-ID. * docs(dsh): drop the gateway reminder limit now that #2771 is merged * docs(dsh): configure the gateway with #2630's model destination contract * fix(dsh): keep Scope routing in the runtime context while recall is off With prompt recall off the pre-step adds no message, because behind the gateway any message after the prompt would replace it as the turn. That also removed the Scope routing, which the guidance requires for MCP operations that take a scope_id. While recall is off, the plugin now contributes the routing to DSH's runtime context (powercontext:scope-routing, required, not interpolated). DSH refreshes that context after the pre-step and sends it as a standalone <system-reminder> user message only when it changes; the gateway does not take such a message as the turn (#2771). The guidance and the DSH guide name both places the routing can appear. * docs(dsh): configure the gateway with master's restored upstream setup #2920 reverted #2630, so the gateway again reaches the upstream through PC_GATEWAY_UPSTREAM_URL_RESPONSES, Core's target comes from PC_GATEWAY_UPSTREAM_PROFILE, and no gateway.user grant or enforced access mode is required. Align the DSH guide (en and zh) with that setup and link the restored Gateway authentication boundaries section.
Which issue or RFC does this PR close?
Reverts #2630 (squash commit
0237a47dd99379dba8c7f3176c8a3591af7f2f4c). Refs #2460.Rationale for this change
Restore the Gateway deployment and transport behavior that existed before #2630. #2630 has not been released. Development deployments using
PC_GATEWAY_UPSTREAM_URL*, optional Core authentication, or environment HTTP proxies should no longer require the breaking configuration migration introduced by that PR.What changes are included in this PR?
server.observerplusscope.contributoron the default and selected Scopes) instead of dropping it with the target-binding terms.Are there any user-facing changes?
Yes.
PC_GATEWAY_UPSTREAM_URL*is accepted again; Responses uses its upstream URL rather thanPC_GATEWAY_UPSTREAM_PROFILE_RESPONSES. Core credentials are required when Core enforces authentication, and the client key is required for non-loopback listeners. Upstream requests again honor environment proxy configuration. Deployments already migrated to #2630 must restore the previous upstream URL configuration. Two-phase checks remain, using the earlier contract.How was this change tested?
Latest repair (
cdfd44383):pytest -q tests/builtin/inference/test_privacy.py— 97 passed.cargo test --locked --manifest-path gateway/Cargo.toml -p pc-gateway-core --test core_proxy— passed (2 test entries; the parent also verifies the isolated child). Real loopback Core and proxy listeners verify that only Core receives the authenticated request.cargo clippy --locked --manifest-path gateway/Cargo.toml -p pc-gateway-core --all-targets -- -D warnings, Cargo formatting, andprek run -a— passed.Earlier validation (not rerun in full on the latest repair):
cargo fmt --manifest-path gateway/Cargo.toml --all --check— passed.prek run -a— passed, including Ruff andty check.pytest -q tests/test_ci_changes.py tests/test_docs_remote_access_contract.py— 192 passed.pnpm check:links— validated 379 public pages and 673 repository files.ruff check tests/native/test_personal_service_lifecycle.pyand Python byte-compilation — passed.upgrade_release_gate.load_policy— passed; current persistence digest matches the checkout.cargo check --workspace— passed.git diff --check— passed. The independent fixes intentionally retained are listed above.cargo test --locked --manifest-path gateway/Cargo.toml --workspace— 349 passed, including mandatory real-Core RPC recovery tests. Optional external Core tests can return early when unavailable; this is not external-provider acceptance.cargo clippy --locked --manifest-path gateway/Cargo.toml --all-targets -- -D warnings— passed.pytest -q tests/e2e/test_gateway_authentication.py tests/e2e/test_gateway_http1_lifecycle.py— 41 passed in 534.72 seconds. Real Python Core/SQLite over UDS and Rust Gateway listeners with fixture providers cover authentication, disconnect/delivery/fallback, staged shutdown, and the unchanged 180-second request deadline. No external model provider was used.git merge-tree --write-tree HEAD origin/master— conflict-free against master246f70beb.External-provider, installed-host, and native database upgrade acceptance are not claimed. GitHub CI must validate this PR's current head and merge result before merge.
AI usage statement
Implemented and validated with OpenAI Codex (GPT-6). The contributor remains responsible for the changes.