Skip to content

test(executors): restore the #10986 reasoning-only fallback guards - #12364

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
pacocartones:test/restore-10986-reasoning-only-guards
Sep 2, 2026
Merged

test(executors): restore the #10986 reasoning-only fallback guards#12364
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
pacocartones:test/restore-10986-reasoning-only-guards

Conversation

@pacocartones

Copy link
Copy Markdown
Contributor

Summary

Related Issues

Validation

  • Change type: other (test-only hardening)
  • Focused tests and category gates from the golden path: tests/unit/command-code-executor.test.ts via the repository runner, 18 pass / 0 fail. Disabling the three fallback guards in commandCode.ts makes exactly these two tests fail (non-stream content becomes ""; stream emits 0 content deltas); the file was restored unchanged afterward.
  • npm run lint — repository-wide eslint exit 0 (run with --pass-on-unpruned-suppressions; the literal command reports only pre-existing unused global suppressions on this base); npm run typecheck:core 0; git diff --check clean; npm run check:changelog-integrity OK
  • Reconciled with the current active release base release/v3.8.51@158647618; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR: not applicable, no production code changed
  • SonarQube is temporarily opt-in while the private project has no quota; it is not a PR gate.

Tests Added Or Updated

  • tests/unit/command-code-executor.test.ts: added goPlanFallbackFetch() helper and two tests:
    • Command Code /alpha/generate fallback: reasoning-only output falls back to reasoning as content (non-stream) (#10986)
    • Command Code /alpha/generate fallback: reasoning-only output emits a content delta chunk when streaming (#10986)
  • No production code changed.

Coverage Notes

  • No change to src/, open-sse/, electron/, or bin/. The restored tests exercise the existing reasoning-only branches of createJsonResponse and createStreamResponse in open-sse/executors/commandCode.ts, so coverage of that file can only move up.

Reviewer Notes

…ck guards

The diegosouzapw#10265 rewrite of tests/unit/command-code-executor.test.ts (b6412c6)
dropped the two regression tests that diegosouzapw#10986 added for reasoning-only
Command Code output, even though the production fallback in
createJsonResponse / createStreamResponse (open-sse/executors/commandCode.ts)
survived that rewrite. Since diegosouzapw#10265 the CLI translator is only reachable
through the /alpha/generate fallback taken when /provider/v1/chat/completions
answers 403/404, so the restored tests are routed through that path via a
shared goPlanFallbackFetch() helper.

- non-stream: a reasoning-only /alpha/generate stream yields
  message.content equal to the reasoning text, with reasoning_content still
  populated and reasoning_tokens carried through from totalUsage.
- stream: exactly one synthesized content delta is emitted, after the
  reasoning delta and before the finish chunk.

Both tests pass against the current fallback and fail when that fallback is
disabled. No production code changed.

Related to diegosouzapw#10986, diegosouzapw#12130

Co-authored-by: Leon Marcos <leonaniagomez@gmail.com>
@pacocartones
pacocartones force-pushed the test/restore-10986-reasoning-only-guards branch from 354f34a to 4f90cfc Compare September 1, 2026 23:30
@diegosouzapw
diegosouzapw merged commit d337c5d into diegosouzapw:release/v3.8.51 Sep 2, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(backend): OpenAI API returns null content when model output consists of reasoning tokens (e.g. command-code/meta/muse-spark-1.2-contributor)

2 participants