Repository navigation
ci: gate releases on CI, and cover the checkpoint CI could not see - #127
Merged
Merged
Conversation
Two changes, because gating alone would not have prevented the last bad release. **Gating.** release.yml triggered directly on push, so it built and published concurrently with CI Pipeline and did not depend on it — a red pipeline still shipped a binary. It now triggers on workflow_run after CI Pipeline completes, and the job requires conclusion == success. The checkout pins workflow_run.head_sha so the release builds exactly the commit CI validated rather than a branch tip that may have moved. workflow_run carries no path filter, so the old `paths:` list is reimplemented as an explicit check against the previous release tag; a docs-only commit no longer publishes. Submodule pointer moves count as source changes — the Gemma 4 fix reached users through a bump with no .swift diff at all. Manual dispatch is unchanged and still bypasses the gate. **Coverage.** Replaying the gate against real history showed it would NOT have blocked b674: CI was green on that commit. The Gemma 4 regression escaped because no job loads gemma-4-e2b-it-4bit, which ships k_proj/v_proj for its KV-shared layers while e4b omits them. So test-server.sh takes the model from SWIFTLM_TEST_MODEL, and the matrix gains a second server entry running the same 74-assertion smoke test against e2b. Verified: 74/74 pass against e2b with the fix; reverting the fix fails the job immediately with the production error, "Unable to set language_model.model.layers.15.self_attn.v_proj". Also dry-ran the source-change detector against six change shapes and four real commits. Co-Authored-By: Claude Opus 5 <[email protected]>
This was referenced Aug 8, 2026
solderzzc
added a commit
that referenced
this pull request
Aug 8, 2026
- release.yml's comment asserted the opposite of the new behaviour: it said opencode is continue-on-error so its failures do not block releases. This PR removed that waiver, and #127 gates releases on CI success, so an opencode failure now stops the release. That coupling is intentional but was documented nowhere else. - The simulation omitted stream_options: {include_usage: true}, which opencode's networking layer injects into every streaming request. It makes SwiftLM append a terminal chunk with an empty `choices` array — exactly the shape a strict SSE client can trip on, and previously covered only by curl+grep, never by an SDK parser and never alongside tools. - A run where the model emits no tool call still passes, by design, so the job cannot flake. But it could then go quietly vacuous — green forever while the reassembly path stops being exercised — so that case now prints a loud WARNING. Local run: 2 passed, 0 failed, 31 chunks, finish_reason=tool_calls, tool_calls=1 with the usage chunk present. Co-Authored-By: Claude Opus 5 <[email protected]>
solderzzc
added a commit
that referenced
this pull request
Aug 8, 2026
* test: simulate opencode's request instead of running its CLI The opencode job has been red on every PR for weeks. Its Test 2 installed opencode-ai from npm and ran `npx opencode run`, which the runner OOM-kills (`Killed: 9`) — after the server had already answered correctly. The failure said nothing about SwiftLM, and a permanently red job that nobody can act on is a job people stop reading. What is worth testing is the request shape opencode sends, so Test 2 now issues it directly through the OpenAI SDK: a coding-agent system prompt, a tool catalogue, streaming on. It then reassembles the response the way a strict client must — tool-call deltas keyed by index — and asserts the stream parses, reports a finish_reason, every tool call carries a function name, and the accumulated arguments are valid JSON. No npm, no CLI, no OOM. Because the job can now pass, it is no longer continue-on-error: a failure here means SwiftLM misbehaved and should block the merge. Local run against the same model CI uses: 2 passed, 0 failed — 28 chunks, finish_reason=tool_calls, tool_calls=1, so the tool-call reassembly path is genuinely exercised rather than skipped. Refs #128. Co-Authored-By: Claude Opus 5 <[email protected]> * test: address review findings on the opencode simulation - release.yml's comment asserted the opposite of the new behaviour: it said opencode is continue-on-error so its failures do not block releases. This PR removed that waiver, and #127 gates releases on CI success, so an opencode failure now stops the release. That coupling is intentional but was documented nowhere else. - The simulation omitted stream_options: {include_usage: true}, which opencode's networking layer injects into every streaming request. It makes SwiftLM append a terminal chunk with an empty `choices` array — exactly the shape a strict SSE client can trip on, and previously covered only by curl+grep, never by an SDK parser and never alongside tools. - A run where the model emits no tool call still passes, by design, so the job cannot flake. But it could then go quietly vacuous — green forever while the reassembly path stops being exercised — so that case now prints a loud WARNING. Local run: 2 passed, 0 failed, 31 chunks, finish_reason=tool_calls, tool_calls=1 with the usage chunk present. Co-Authored-By: Claude Opus 5 <[email protected]> --------- Co-authored-by: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two changes. The second exists because, while verifying the first, I found that gating alone would not have prevented the last bad release.
1. Releases now wait for CI
release.ymltriggered directly onpush, so it built and published concurrently withCI Pipelineand did not depend on it — a red pipeline still shipped a binary. Just merging #125 demonstrated it: the release finished and published whilemain's CI was stillqueued.workflow_runonCI Pipeline→completed, with the job guarded onconclusion == 'success'.workflow_run.head_sha, so the release builds exactly the commit CI validated rather than a branch tip that may already have moved on.workflow_runcarries no path filter, so the oldpaths:list is reimplemented as an explicit diff against the previous release tag — a docs-only commit no longer publishes. Submodule pointer moves count as source: the Gemma 4 fix reached users through a bump with no.swiftdiff at all, so omitting that would have silently stopped shipping submodule fixes.workflow_dispatchis unchanged and still bypasses the gate.One property worth knowing:
CI Pipelineconcludessuccesswhen only theopencodejob fails, since that job iscontinue-on-error. Verified against32987d8— opencode failed, workflow concluded success. So the known runner OOM does not block releases.2. The gate would not have caught b674 — so this adds the coverage that does
I replayed the gate against real history before claiming it worked:
32987d8(built b674)8aad37db674 shipped a Gemma 4 regression while CI was green, because no job loads
gemma-4-e2b-it-4bit. That checkpoint shipsk_proj/v_projfor its KV-shared layers whilee4bomits them, so a change validated against e4b broke e2b entirely and nothing noticed.So
tests/test-server.shnow takes its model fromSWIFTLM_TEST_MODEL, and the matrix gains a secondserverentry running the same 74-assertion smoke test against e2b. Cache keys are per-entry so the twoserverjobs don't collide.Verification
Unable to set language_model.model.layers.15.self_attn.v_proj … none not compatible with […].Caveat on this PR's own CI
Because the trigger changes, this PR's release behaviour cannot be fully exercised until it is on
main—workflow_runfires from the version of the workflow on the default branch. The first merge after this lands is the real test, andworkflow_dispatchremains as the escape hatch if anything misbehaves.🤖 Generated with Claude Code