Skip to content

Delivery:Frontstage Callable SSE 流式协议与生命周期 #1400

Description

@JAVA-LW

2026-07-21:AC-025 superseding delta

本 Delivery 的 SSE stream identity 改为源码描述符 { interfaceId, schemaDigest },不再读取 binding alias 或 Page Document binding。stream_open / stream_next / stream_cancel 在 Worker、Host、trace 与后端共享同一 descriptor,并保持 pull-based、取消、清理、脱敏和 Catalog/ACL 校验。旧 alias stream contract 不兼容。

父级

纵向结果

Frontstage 代码区块能够从完整 OpenAPI 生成并消费 Console SSE operation,使用受控 AsyncIterable<T>,支持取消、背压、运行结束清理和可观测事件,不开放 Worker 任意网络。

Contract

  • 两条现有 Console debug stream route 必须先成为正式 OpenAPI operation。
  • 生成函数使用 ctx.interfaces.stream<T>(alias, request): AsyncIterable<T>
  • Host 拥有 HTTP/SSE 连接、认证 header、事件解析、背压、上限和取消;Worker 只消费结构化事件。
  • Stream 与 Draft Run 生命周期绑定;停止运行、关闭 Studio、超时或页面卸载均必须取消。
  • 目标 API 继续执行原权限与资源 ACL。

验收点

  • AC-STR-001:两条真实 SSE route 进入全量 Console OpenAPI/Callable 集合。
  • AC-STR-002:生成的 stream 函数具有明确事件 DTO 与 AsyncIterable 返回类型。
  • AC-STR-003:允许路径收到有序事件;越权返回原 401/403;断连、取消和超时可观察。
  • AC-STR-004:慢消费者有界背压,运行结束无遗留连接或跨 run 事件。
  • AC-STR-005:浏览器能绑定、运行、停止并在 Interface Calls/Console 中观察真实流式调用。

Work Packet 边界

集中验证

本 Delivery 的代码与 fixture 先装配进 Root assembly,不做独立 QA;Root 冻结后由唯一集中 Test Batch 验证。

停止条件

  • 必须绕过 Worker Host 才能建立连接。
  • 无法把连接生命周期绑定到既有 run/session owner。

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiPublic API or protocol contract workarea:backendBackend API, service, repository, or runtime workarea:frontendFrontend UI or interaction workarea:runtimeRuntime and execution behaviorchild-issueChild implementation issuecontractContract or API semantics changegrade:g3Cross-domain decision or implementation workneeds-backendNeeds backend workneeds-frontendNeeds frontend workphase:implementationImplementation in progressplan:treeLong plan with one Root and vertical Delivery issuesrisk:highHigh risk if implemented incorrectlysize:lLarge implementation and review sizetype:featureFeature or new capability

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions