Do not trust stream:false until the CometAPI adapter preserves it

Do not trust stream:false until the CometAPI adapter preserves it

A stream:false option is only a promise if the adapter sends it unchanged and the application handles the resulting response as intended. The pinned LobeHub CometAPI provider shows why that distinction matters.

In packages/model-runtime/src/providers/cometapi/index.ts at commit 39bce329fdca4927e2bdca84a95f7cfd864f7629, handlePayload separates model from the payload and returns the rest of the fields with model and stream: true. That transformation overrides a caller’s stream:false. The evidence supports a narrow conclusion: this adapter revision forces the outgoing payload’s stream flag to true at that boundary. It does not establish what the shared runtime factory or application consumer does afterward.

CometAPI’s documentation describes an OpenAI-compatible endpoint at https://api.cometapi.com/v1 and demonstrates reading a completed message from a chat-completion response. That is useful service-level integration context, but compatibility documentation is not proof that a wrapper preserves every option. A maintainer integrating CometAPI through this adapter should therefore inspect the effective request and the downstream result consumer before advertising non-streaming behavior. Check the adapter’s final payload, then trace whether the consumer expects chunks, assembles them, or requires a completed object.

Do not “fix” the concern by merely buffering chunks in the application: buffering can produce a complete local result, but it does not make the upstream request non-streaming. Conversely, this source packet does not justify claiming that CometAPI rejects non-streaming requests, that every LobeHub version behaves this way, or that a live request has failed. The actionable decision is narrower: treat the option as untrusted until the pinned adapter and its consumer are verified together.

I would add an interrupted-response case to the acceptance gate, not just compare the requested and effective stream flags. For the pinned CometAPI adapter, the forced stream: true makes “a complete object was returned” an insufficient success criterion: a consumer test should distinguish normal completion from a connection ending partway through.

A bounded test plan would be:

  • Use synthetic input with stream:false and capture only the effective stream flag at the adapter boundary. Keep credentials and prompt bodies out of diagnostic logs.
  • Feed the consumer a controlled streaming fixture that completes normally, then one that terminates before its expected completion signal. These are proposed tests, not observed behavior of the shared runtime.
  • Require the interrupted case to produce an explicit incomplete/error outcome rather than a success-shaped result assembled from partial chunks. Record completion status separately from whether any text arrived.

If the consumer cannot distinguish those outcomes, stop the rollout for workflows requiring a complete result. Do not add automatic retries as a substitute for that distinction; any retry policy should have an explicit attempt limit and account for whether downstream work has already started. This gate would test failure handling, while leaving the upstream non-streaming promise unresolved until the adapter actually preserves the option.