Skip to content

port(upstream): #3506 - harden Claude trailing prefill and tool types - #623

Merged
bloodf merged 2 commits into
mainfrom
campaign/issue-580
Aug 27, 2026
Merged

bloodf merged 2 commits into
mainfrom
campaign/issue-580

Conversation

@bloodf

@bloodf bloodf commented Aug 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • What changed: Ports upstream #3506 and covers stacked #3484. Adds shared Claude assistant-prefill policy across translated and native Claude paths, passes native request headers into Claude passthrough normalization, and preserves declared Claude/server tool types instead of overwriting them with the fallback. Includes compatibility regressions.
  • Why it changed: Claude requests ending in assistant prefill need consistent continuation handling, while callers that explicitly request preservation must retain the terminal assistant turn. Typed/server tools must remain typed rather than falling back to custom.

Type

Select one (conventional commit prefix):

  • feat: — new feature
  • fix: — bug fix
  • refactor: — code change that neither fixes a bug nor adds a feature
  • docs: — documentation only
  • ci: — continuous integration / build / deployment
  • chore: — maintenance, tooling, or other non-code change

This upstream port uses the repository's port(upstream): commit convention.

Breaking changes

  • No
  • Yes — describe below:

Testing

  • What was tested: Focused translator compatibility coverage for translated and native Claude assistant-prefill policy; focused native Claude tool-type fallback coverage; existing cache-control and reasoning-history compatibility cases.
  • Commands run: Canonical gate and focused coverage at exact head 05bb4417cbd68c91413bf666e9609fc9209b14f9; commitlint, docs, registry, and build checks all passed.
  • Evidence (logs, screenshots, output links): Exact branch head 05bb4417cbd68c91413bf666e9609fc9209b14f9. Canonical gate: PASS under Node v20.20.2, ABI 115; focused coverage: 5 files / 68 tests passed; full npm run test:ci: RC 0, raw / known / stale failures 0, baseline additions 0; lint / docs / registry / build: PASS. Pinned judge judge-580-current: APPROVED, no blockers.

Files, docs, and changelog

  • Runtime: open-sse/handlers/chatCore.js, open-sse/translator/concerns/assistantPrefillPolicy.js, open-sse/translator/formats/claude.js.
  • Tests: tests/translator/assistant-prefill-policy.test.js, tests/translator/port-2401-reasoning-history-bridge.test.js, tests/unit/claude-cache-control.test.js, tests/unit/force-stream-config.test.js.
  • Docs: docs/reference/api.md.
  • Changelog: CHANGELOG.md.

Existing PRs

Searched current repository open and closed PRs for #3506, Claude trailing prefill, tool types, and campaign/issue-580. No duplicate implementation PR found. Search returned only unrelated #291 (merged Claude Copilot native routing) and #95 (closed server-tool literal names).

Authoring environment

  • Model: durindoor/cx/gpt-5.6-terra.
  • Harness: Oh My Pi. Harness version: not exposed by this session.
  • Installed plugins: no plugin inventory exposed to this session.
  • Human involvement: branch contents and requested PR metadata were supplied by the human partner; this draft awaits human review of the complete diff before submission.

Checklist

  • Tests added or updated for behavioral changes
  • No new dependencies without explicit justification
  • Conventional commit used (port(upstream):; validated by commitlint)
  • CHANGELOG updated if this change is user-facing
  • No secrets, keys, credentials, or tokens committed

Closes #580

@bloodf
bloodf force-pushed the campaign/issue-580 branch from 5daa30d to 026a2c6 Compare August 27, 2026 22:33
Agent added 2 commits August 27, 2026 23:04
…fallback

Covers stacked #3484. Adds shared assistant-prefill policy applied on
translated and native Claude paths, threads native request headers
through normalizeClaudePassthrough options, and fixes the Claude tool
fallback spread order so typed/server tools keep their object identity.

Closes #580
@bloodf
bloodf force-pushed the campaign/issue-580 branch from 026a2c6 to 05bb441 Compare August 27, 2026 23:05
@bloodf
bloodf marked this pull request as ready for review August 27, 2026 23:14
@bloodf
bloodf merged commit 1f1a3ec into main Aug 27, 2026
3 checks passed
@bloodf
bloodf deleted the campaign/issue-580 branch August 27, 2026 23:14
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.

port(upstream): #3506 + #3484 - Claude trailing prefill and tool-type hardening

1 participant