Skip to content

CI has no second SSE client implementation after the opencode CLI was removed #134

Closed

Description

@solderzzc

#131 replaced the opencode job's real-CLI invocation with a simulated request, because the runner OOM-killed npx opencode run after the server had already answered correctly. That was the right call — the old test's assertions were a two-string grep that would have passed even if opencode never reached the server — but it does cost one genuine axis of coverage.

What was lost

Every SSE assertion in CI now goes through Python httpx (the OpenAI SDK, in both test-opencode.sh Test 1 and Test 2, and test-contract.sh). opencode is a Node client on undici, which is a different parser with different tolerances.

That matters concretely here: SwiftLM frames SSE with \r\n\r\n (Sources/SwiftLM/Server.swift:2848, 2762, and elsewhere) rather than the spec's \n\n. httpx tolerates it. Whether every strict client does is exactly the kind of thing only a second, independent parser establishes — and there is no longer one in CI.

Suggested fix

A Node one-liner, no npm install: node is preinstalled on macos-15, and fetch plus a manual SSE split is enough to assert the stream parses, deltas accumulate, and [DONE] terminates. Near-zero memory, so it does not reintroduce the OOM that motivated #131.

Worth asserting from Node specifically:

  • the \r\n\r\n framing is accepted
  • the terminal usage chunk with an empty choices array (sent when stream_options: {include_usage: true}) does not break accumulation
  • tool_calls deltas carry index

Related

While reviewing #131 it also surfaced that tool_choice and parallel_tool_calls are accepted and silently ignored — ChatCompletionRequest has no such fields and Swift's Decodable drops unknown keys. A client sending tool_choice: "required" gets no error and no enforcement. Pre-existing and separate from this, but worth its own issue if OpenAI-compat fidelity matters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions