Skip to content

fix: separate Laguna bridge turns after clean stops - #207

Draft
hallerite wants to merge 1 commit into
codex/preserve-tool-string-whitespacefrom
codex/laguna-bridge-separator
Draft

hallerite wants to merge 1 commit into
codex/preserve-tool-string-whitespacefrom
codex/laguna-bridge-separator

Conversation

@hallerite

@hallerite hallerite commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

After a sampled </assistant> or 〈|EOS|〉, Laguna XS.2 and M.1 bridges append the next role immediately, producing </assistant><user> where the checkpoint template requires </assistant>\n<user>.

Append the missing separator as unsampled scaffolding after a clean stop. Preserve the sampled prefix and the existing truncated-turn closure. The existing bridge suite now covers both checkpoints, user/tool continuations, both stop tokens, and truncated completions.

Validation: 8 new seam cases failed before the fix; all 12 pass afterward. The complete bridge, Laguna M.1, and Laguna XS-2.1 suites pass: 175 passed, 36 existing skips. Ruff, formatting, and pre-commit passed.

Stacked on the tool-string fix solely to provide the prerequisite base for #188; this PR's own diff contains only the Laguna fix and its regression cases.

Note

Fix LagunaXS2Renderer.bridge_to_next_turn to separate turns after clean stops

When the prior prompt and completion end with an assistant-end or EOS token, bridge_to_next_turn in laguna_xs2.py now emits a newline at the start of the extension before the next message. The synthesized assistant-end and newline for turns without a stop token are unchanged. Adds a parametrized test in test_bridge.py covering assistant-end, EOS, and missing-stop cases followed by user or tool messages, checking that prior tokens are preserved and the extension starts with the expected separator.

  • Behavioral Change: bridges after a clean stop now start the extension with a newline instead of joining directly to the next message opening.

Macroscope summarized ec216ed.

This branch has not been deployed

No deployments
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.

1 participant