Skip to content

fix(tests,translator): repair post-merge regressions on release/v3.8.2 - #2597

Closed
diegosouzapw wants to merge 1 commit into
release/v3.8.2from
fix/post-merge-regressions-v3.8.2
Closed

diegosouzapw wants to merge 1 commit into
release/v3.8.2from
fix/post-merge-regressions-v3.8.2

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Summary

Two corrections to PRs that merged without their review fixes:

  1. fix(codex): accept auth.json without auth_mode field on import #2536 deleted the isCacheable export but tests/unit/semantic-cache.test.ts still imported it — the whole unit suite failed to load. Rewritten against the current isCacheableForRead / isCacheableForWrite API (caches streaming + non-streaming; requires explicit temperature: 0).
  2. fix: extract system role messages in semantic passthrough path to prevent 400 on memory injection #2474's extractSystemRoleMessages only lifted role=system, dropping role=developer (OpenAI Responses' system alias) into the Anthropic message array — the exact 400 the PR set out to prevent. Now lifts both, matching the normal-path extractSystemMessagesToBody. Adds a developer-role test.

Files

open-sse/handlers/chatCore.ts, tests/unit/semantic-cache.test.ts, tests/unit/system-role-extraction.test.ts (3 files, +63/-23).

Note: branch is behind release/v3.8.2; may need a rebase/conflict pass before merge.

🤖 Generated with Claude Code

Two corrections to PRs that merged without their review fixes:

1. #2536 deleted the isCacheable export but tests/unit/semantic-cache.test.ts
   still imported it — the whole unit suite failed to load. Rewrote the block
   against the current isCacheableForRead / isCacheableForWrite API (caches
   streaming + non-streaming; requires explicit temperature: 0).

2. #2474's extractSystemRoleMessages only lifted role=system, dropping
   role=developer (OpenAI Responses' system alias) into the Anthropic message
   array — the exact 400 the PR set out to prevent. Now lifts both, matching
   the normal-path extractSystemMessagesToBody. Adds a developer-role test.
@kilo-code-bot

kilo-code-bot Bot commented May 22, 2026

Copy link
Copy Markdown

Kilo Code Review could not run — your account is out of credits.

Add credits or switch to a free model to enable reviews on this change.

@diegosouzapw

Copy link
Copy Markdown
Owner Author

Closing as redundant: rebasing this branch onto the current release/v3.8.2 yields 0 unique commits (empty diff) — the change (semantic-cache test repair + developer-role lift in extractSystemRoleMessages) has already landed in release/v3.8.2 via other merges. Verified present in the release branch. No rebase/merge needed.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the system role extraction logic to include the "developer" role as a system-equivalent role for OpenAI parity and refactors the semantic cache into distinct read and write variants. The caching logic now requires an explicit temperature of 0 and supports streaming requests. A review comment identifies that the new isSystemRole helper is duplicated elsewhere in the file and should be moved to a shared scope to improve maintainability.

Comment on lines +1298 to +1300
const isSystemRole = (role: unknown): boolean =>
typeof role === "string" &&
(role.toLowerCase() === "system" || role.toLowerCase() === "developer");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The isSystemRole helper logic is now duplicated with the internal extractSystemMessagesToBody closure found later in this file (lines 2670-2673). While the current implementation correctly fixes the missing developer role regression, consider moving this helper to a module-level scope or a shared utility file to maintain a single source of truth for system-equivalent roles and improve maintainability across the handler.

@diegosouzapw
diegosouzapw deleted the fix/post-merge-regressions-v3.8.2 branch May 23, 2026 07:17
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