Skip to content

[讨论]确认 Native API 作为外层协议唯一真值层 #369

@JAVA-LW

Description

@JAVA-LW

Issue Metadata

Context

OpenAI Chat Completions currently maps request payloads into NativeRunRequest. The requested OpenAI Responses endpoint adds continuation and streaming projection concerns that can easily leak external protocol state into the product core if not constrained.

Decision To Confirm

1flowbase Native API, runtime events, native runs, and native conversation semantics remain the only source of truth. External protocols such as OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages only map into and project out of the native layer.

Rationale

  • Native API is the stable product contract for application execution.
  • External protocols change independently and should not dictate internal state ownership.
  • previous_response_id should be treated as an external cursor that resolves back to native run/conversation/history semantics.
  • stream: true should project native runtime events into the external SSE shape, not create a second event source.

Alternatives Considered

  • Conservative: only add /openai/v1/chat/completions; rejected because it does not address Responses continuation.
  • Balanced: add Responses adapter while keeping native truth; recommended.
  • Aggressive: emulate OpenAI Responses state as an internal source of truth; rejected because it creates a second state model.

Open Decisions

  • Confirm that missing capabilities must be added to Native first, then projected by adapters.
  • Confirm that no OpenAI-owned conversation/session durable store is allowed in this work.

Acceptance Evidence

  • User confirms this decision issue before L2/L3 implementation proceeds.
  • Child issues inherit this invariant and stop if implementation needs to change it.

Lifecycle

  • Current phase: phase:discussion
  • Close condition: user confirms decision and all direct child workstreams complete.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiPublic API or protocol contract workarea:backendBackend API, service, repository, or runtime workchild-issueChild implementation issuecontractContract or API semantics changegrade:g4Architecture or data risk worklevel:l1Decision issue / ADRparent-issueParent tracking issuephase:discussionRequirement discussion and decision shapingpriority:p1High priorityrisk:highHigh risk if implemented incorrectlysize:sSmall implementation and review sizetype:designDesign or contract shaping work

    Type

    No type
    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