Skip to content

Feat/bisheng work 110 - #2514

Open
zgqgit wants to merge 24 commits into
mainfrom
feat/bisheng-work-110
Open

zgqgit wants to merge 24 commits into
mainfrom
feat/bisheng-work-110

Conversation

@zgqgit

@zgqgit zgqgit commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

What

简要描述做了什么改动。

Why

为什么需要这个改动?

How

实现方式、设计决策(如有)。

Test

  • 本地测试通过
  • 114 测试服务器验证通过

Related

  • Issue/ticket:

yaojin3616 and others added 24 commits October 15, 2026 08:27
# Conflicts:
#	src/backend/bisheng/utils/http_middleware.py
- Reuse ToolExecutor.init_by_tool_id (permission + init) instead of a
  dedicated init_saved_openapi; drop the duplicate permission handling.
- Split SavedToolSchema.from_saved into focused helpers and keep only the
  strict schema; document why the OpenAPI source is re-parsed (the importer
  drops body constraints such as enum and length bounds).
- Fix number validation overflowing on huge ints (500 -> 400).
- Send validated arguments as-is in BoundedOpenApiTools; the legacy mapper
  coerced number fields to float and lost precision.
- Single deadline in the endpoint; extract _run_until_disconnect; remove the
  repeated input-size check and dsh_verified_at side effect.
- Derive the lease TTL from the timeout limit; share TOOL_CODE_PATTERN.
- ToolInvocationRoute: top-level import, no re-parsing of the response body
  for request_id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n Responses

- Replace x-dsh-conversation-id / x-dsh-request-purpose headers with the body
  field audit_context.{conversation_id, request_kind}, the same keys and values
  as feat/3.0.0-dsh-audit. Invalid context only drops affinity, never fails the
  model request.
- Compaction shares the conversation cache scope; only session-title is separate.
- Send prompt_cache_key on Chat as well for OpenAI/Azure providers.
- Responses: skip unknown event types instead of failing a billed stream; only
  enforce sequence_number ordering when present; allow azure_openai using the
  deployment name.
- Drop the non-OpenAI "max" effort id.
- Bound model request bodies in the endpoint instead of path matching in
  DshRoute; remove the redundant re-serialization size check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the audit-only changes from feat/3.0.0-dsh-audit at 5d95e1b without merging unrelated release-line features.

Include tenant audit modes and encrypted originals, bounded deferred stream persistence, exact-name/status queries, conversation and sub-agent trees, Chinese source rendering, conversation title reporting, UI fixes, maintenance scripts and contracts.

Preserve work-110 image-count behavior, admission/seat/billing/market logic and dependency locks. Extend its existing f065_dsh_install_policy_default_off head with new work110 audit revision IDs; retain published migration history and document cross-chain deployment limits.

Validation: backend combined regression 290 passed / 3 skipped / 2 deselected; frontend 83 passed; isolated MySQL and actual client-adapter loopback HTTP each passed. Platform typecheck/build, changed-file lint, Ruff, i18n and single-head checks passed. Full-suite failures match the original target baseline; details in work110-port.md. Exclude unrelated seat-removal notes; no desktop/Gateway changes or deployment.
Move desktop PKCE authorization, token issuance and device sessions into BiSheng.
Remove commercial seat admission while preserving model quotas, usage history and full model auditing.
Document migration, validation results and remaining deployment checks.
Port PR #2502 without merging its source branch history. Keep work-110 native
sessions, installation switches and workbench APIs, without a Desktop seat gate.
Preserve original artifact integrity checks and expose unsigned contract v2.

Validate backend market tests (72), platform UI tests (16), client market tests
(45) and cross-repository ZIP/tgz and snapshot contracts. Full frontend lint
and typecheck have identical failures before and after this port.

Source-PR: #2502
Ported-from: 29ab7fd
Preserve model audit capture alongside bounded Chat/Responses requests, conversation affinity and saved tools. Add Responses audit lifecycle hooks and shared request IDs. Keep deployed audit codes and move new tool codes to 26142-26152 to avoid silent locale key collisions; regenerate all locale artifacts.

Validation: 203 focused tests passed, 2 skipped; Ruff and i18n checks passed. SOCKS dependency import failures reproduced on the premerge baseline.
## Summary
- Expose existing saved OpenAPI tools through POST
/api/v1/dsh/tools/{toolCode}/invoke using existing tool_key, tenant
identity and use permission.
- Remove separate publication management, aliases and publication state;
reuse saved schemas, destinations and credentials.
- Add bounded request/response handling, timeout/disconnect
cancellation, distributed concurrency leases and credential-safe
errors/logging.
- Update feature documentation, API tests and localized error messages.

## Validation
- Schema, transport and lease focused tests: 25 passed.
- Combined focused HTTP run: 35 passed, 1 failed during router import
(bisheng.common.services resolved as a non-package); root cause not
confirmed.
- Integration test collection blocked locally by missing
langchain_elasticsearch dependency.
- git diff --check passed before commit.

## Known review findings (not fixed yet)
- number arguments may be coerced to float by the legacy mapper and lose
precision.
- math.isfinite on a sufficiently large integer raises an uncaught
OverflowError.
- Authentication field-name collision checks do not distinguish
header/query/body namespaces.
- Follow-up simplification: remove repeated parameter assembly and
clarify async-only bounded transport.

This PR submits the current implementation; it does not claim the above
review findings have been resolved. Production Gateway/FGA/database
integration verification remains outstanding.


## Enterprise Model Protocol Extension

- Add administrator-declared reasoning efforts and defaults through
existing model advanced parameters, publish validated capabilities in
the model directory, and validate/forward Chat reasoning_effort before
usage admission.
- Add controlled conversation/purpose headers with server-derived
tenant/user/model-scoped supplier session_id and native
prompt_cache_key.
- Add independently negotiated stateless POST /api/v1/dsh/responses
using the configured SDK client, typed
function/reasoning/encrypted-history support, bounded transport, and
shared authentication/authorization/quota settlement.
- Preserve the PR's shared desktop_principal and tool error-route
refactors. Desktop-side changes remain in the bisheng-work workspace and
are not part of this PR.

### Additional Validation

- Combined model protocol and saved-tool regression on the updated PR
branch: 174 passed, 3 skipped.
- Cross-repository real loopback HTTP test through Desktop
serializer/broker, Bisheng API/schema/governance and OpenAI SDK: passed
for Chat/native default and explicit efforts; external identity/quota
stores and supplier HTTP are isolated substitutes.
- Ruff and git diff --check passed.
- Not deployed; actual supplier, Gateway/Sub2API forwarding, installed
Desktop and production database validation remain outstanding.
Render nonstream Chat and native Responses audit bodies without duplicating final snapshots. Route Responses through desktop authentication and scope saved-tool credential collisions to their wire location. Add focused parser, UI, middleware and transport regressions.
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.

2 participants