Skip to content

Pass x-opencode-session for memory, roll-call, and expand-prompt calls - #14015

Merged
intentionally-left-nil merged 5 commits into
mainfrom
fix/more-opencode-headers
Sep 17, 2026
Merged

intentionally-left-nil merged 5 commits into
mainfrom
fix/more-opencode-headers

Conversation

@intentionally-left-nil

Copy link
Copy Markdown
Contributor

Issue

The previous fix for opencode's backend only resolved the main inference endpoints (that we share with opencode). Kilo has other entrypoints that use inference, and all of these need the x-opencode-session headers as well

Fixes #13723

Implementation

How to Test

kilo roll-call anthropic, using the vscode plugin with this fix, and using memory

Manual/local verification

TBD

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

@kilo-code-bot

kilo-code-bot Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The new opencodeSessionHeaders helper correctly mirrors the providerID.startsWith("opencode") gate and User-Agent used by LLMRequestPrep.prepare, and it is wired into all three direct AI SDK call sites (memory consolidation, roll-call, prompt enhancement). All touched files are Kilo-owned paths, so no upstream merge markers are needed. The required sessionID addition to MemoryPorts.ModelPort.run is applied consistently across the host adapter and kilo-memory callers, and the new tests exercise the real header plumbing rather than mocking it. No resource leaks introduced in the changed code.

Files Reviewed (9 files)
  • .changeset/opencode-session-header-followup.md
  • packages/kilo-memory/src/effect/capture.ts
  • packages/kilo-memory/src/effect/ports.ts
  • packages/opencode/src/kilocode/cli/cmd/roll-call.ts
  • packages/opencode/src/kilocode/enhance-prompt.ts
  • packages/opencode/src/kilocode/memory/ports.ts
  • packages/opencode/src/kilocode/provider/opencode-session-headers.ts
  • packages/opencode/test/kilocode/memory/memory-ports.test.ts
  • packages/opencode/test/kilocode/provider/opencode-session-headers.test.ts

Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

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.

Send x-opencode-session header on API requests (required by OpenCode Go from 09/05)

2 participants