Skip to content

docs: correct the OpenCode/Kilo workaround, which does not exist - #1374

Merged
1a1a11a merged 2 commits into
devfrom
claude/session-id-known-agents-6fx73x
Sep 6, 2026
Merged

1a1a11a merged 2 commits into
devfrom
claude/session-id-known-agents-6fx73x

Conversation

@1a1a11a

@1a1a11a 1a1a11a commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #1371, correcting guidance I got wrong there.

What prompted it

The console still showed no session for OpenCode and Kilo after #1371 deployed to staging. Checking which rows were affected settled it: Claude Code and Codex rows do carry sessions, so the gateway side works end to end — resolver, metadata["session_id"], the api_logs.session_id column, the admin query, the response model, the console. The gap is entirely client-side.

The error

#1371's docs said: on the runner that sends no headers, add a chat.headers plugin that sets X-Session-ID.

That is useless in both directions:

  • The chat.headers hook exists only on the older packages/opencode/src/session/llm/request.ts path — which already builds the header block directly. Where the hook exists, nothing needs fixing.
  • The newer core runner (packages/core/src/session/runner/llm.ts, registered as SessionRunnerLLM.node in location-services.ts) has neither the header block nor any plugin hook. Where the headers are missing, there is nothing to hook.

I verified both against the sst/opencode and Kilo-Org/kilocode trees rather than reasoning from the earlier read.

What it says now

The two paths are named explicitly, along with the registration site, so the next reader can confirm it in about a minute instead of trusting the prose. And the two real remedies:

  • OpenCode — upgrade past sst/opencode#43188 (2026-08-18), which restored the block on the core runner.
  • Kilo Code — forked before that restore, so it needs the same change ported into the fork. There is no gateway-side or config-side substitute.

Docs only; no code change.

Verification

make lint clean and make docs-verify reports translations match the English build. Both rewritten paragraphs are translated in the zh_CN catalog.


🤖 Generated with Claude Code

https://claude.ai/code/session_01WpETEerrhcCpsg69ucjrEt


Generated by Claude Code

Confirmed against both trees while debugging why the console still shows no
session for these clients: the gateway side works (Claude Code and Codex rows
carry sessions), and the gap is entirely client-side.

What I had written was wrong in a way that would waste someone's afternoon.
The advice was to add a `chat.headers` plugin on the runner that sends no
headers. That hook exists only on the OLDER `packages/opencode` path -- which
already builds the header block directly. The newer core runner
(`packages/core/src/session/runner/llm.ts`, the one `location-services.ts`
registers as SessionRunnerLLM.node) has neither the header block nor any
plugin hook to add one with. So where the hook exists the fix is unnecessary,
and where the headers are missing there is nothing to hook.

The text now says that plainly, names the file and the registration so the
next reader can check it in a minute, and gives the two real remedies:
upgrade OpenCode past anomalyco/opencode#43188, and for Kilo port that same change
into the fork, since Kilo branched before the restore.

`make lint` and `make docs-verify` pass; the zh_CN catalog carries both
rewritten paragraphs.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WpETEerrhcCpsg69ucjrEt
Copilot AI lite review requested due to automatic review settings September 6, 2026 22:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-06T22:14:53.633092Z af1019a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The rewritten docs aim to be exact about file locations but currently cite the core runner path without the src/ segment, which risks sending readers to the wrong/non-existent file.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the developer database documentation to correct guidance around OpenCode/Kilo Code session headers, clarifying which client request path does (and does not) send session headers and why the previously suggested chat.headers workaround is not applicable on the missing-header path.

Changes:

  • Rewrites the OpenCode/Kilo session-header paragraph in docs/developer/database.md to distinguish the two runners and the absence of a plugin hook on the newer path.
  • Updates the zh_CN gettext catalog entries to match the revised English paragraphs (plus POT creation timestamp update).
File summaries
File Description
docs/developer/database.md Clarifies OpenCode/Kilo request paths and removes the incorrect “add chat.headers” workaround guidance for the core runner path.
docs/developer/locale/zh_CN/LC_MESSAGES/database.po Updates zh_CN translations for the rewritten paragraphs and refreshes POT metadata.
Review details

Suppressed comments (1)

docs/developer/locale/zh_CN/LC_MESSAGES/database.po:585

  • The Chinese translation mirrors the same (likely incorrect) core runner path without the src/ segment; update it to match the corrected path so the translation stays consistent with the English doc.
"这些客户端有两条请求路径,只有其中一条会发会话头。较旧的 `packages/opencode` 路径直接"
"构造这些头;较新的 `packages/core/session/runner/llm.ts` runner 一度把它们弄丢了,"
"上游在 `sst/opencode#43188`(2026-08-18)中才补回来。Kilo Code 是在那次修复之前分叉"
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/developer/database.md Resolved
Copilot caught that the paragraph cited `packages/core/session/runner/llm.ts`
without the `src/` segment. The file is `packages/core/src/session/runner/llm.ts`
in both trees; the path as written resolves to nothing.

That matters more than a typo usually would: the point of naming the file was
so a reader could confirm the claim in a minute rather than take the prose on
trust, and a path that does not exist defeats exactly that. Fixed in the English
and in the zh_CN translation, which had mirrored it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WpETEerrhcCpsg69ucjrEt
@1a1a11a
1a1a11a merged commit a194d30 into dev Sep 6, 2026
17 checks passed
@1a1a11a
1a1a11a deleted the claude/session-id-known-agents-6fx73x branch September 6, 2026 22:24
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.

3 participants