Skip to content

fix(live): provide stable OpenCode session identity - #150501

Merged
RomneyDa merged 1 commit into
mainfrom
fix/frv-opencode-live-session
Sep 17, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/frv-opencode-live-session

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Summary

  • give direct live-model completion probes a stable per-model session identity
  • let OpenCode attach its required session header during live validation
  • keep OpenAI probe instructions centralized with the session helper

Validation

  • pnpm vitest run src/agents/live-model-session-id.test.ts
  • pnpm check:changed

Release evidence

Fixes the OpenCode live-model HTTP 400 failures in Full Release Validation 35164828118, where every request was rejected because the probe supplied no session identity.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@RomneyDa
RomneyDa enabled auto-merge (squash) September 17, 2026 02:01
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Sep 17, 2026
@RomneyDa
RomneyDa force-pushed the fix/frv-opencode-live-session branch from aeada63 to d03ad46 Compare September 17, 2026 02:04
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 2:24 AM ET / 06:24 UTC (Revision 4).

ClawSweeper review

What this changes

The PR supplies stable per-model session IDs to direct live-model probes and moves their existing OpenAI instructions into a lightweight tested helper.

Merge readiness

✅ Ready for maintainer review

This remains a useful, bounded live-validation fix. The related merged changes do not supply stable per-model identity at this direct probe call site, and no blocking defect was found.

Priority: P2
Reviewed head: 3eacb2a811e5c4e11b92f0055c26d05870f56b54

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair using an established transport contract, with no blocking correctness or security finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate; focused helper checks are reported, but an after-fix OpenCode completion was not independently observed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate; focused helper checks are reported, but an after-fix OpenCode completion was not independently observed.
Evidence reviewed 7 items Pinned introduced change: The reviewed diff supplies the fallback immediately before completeSimple, preserves an explicit sessionId with nullish coalescing, and retains the existing timeout signal. OpenAI instruction text is unchanged.
Existing transport contract: The canonical header resolver consumes sessionId, restricts generated OpenCode headers to the HTTPS OpenCode host, and preserves explicit model or request headers. The patch uses this existing mechanism rather than adding another header policy.
Documented distinction between low-level and prepared calls: The provider documentation requires low-level stream callers to supply sessionId. Prepared standalone completions generate their own routing header, but the live suite calls completeSimple directly and does not use that prepared executor.
Findings None None.
Security None None.

How this fits together

The live-model suite sends diagnostic prompts to selected providers and reports completion failures during release validation. Its session ID feeds the existing transport policy that attaches OpenCode routing headers.

flowchart LR
  A[Selected provider and model] --> B[Live completion probe]
  C[Explicit session ID] --> D[Preserve explicit or derive stable ID]
  B --> D
  D --> E[Existing provider transport]
  E --> F[OpenCode routing header]
  F --> G[Completion result and validation report]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +10, Tests +2. Total +12 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 10 0 +10
Tests 2 25 23 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 35 23 +12

Review metrics

None.

Technical review

Best possible solution:

Keep probe identity deterministic at the live-test caller while the existing transport owner handles routing headers and explicit-header precedence.

Do we have a high-confidence way to reproduce the issue?

No independently verified HTTP reproduction was established in this read-only review. Source confirms the omitted probe identity and the documented header mechanism; the PR reports the release-validation failure.

Is this the best way to solve the issue?

Yes. Supplying the existing session option at the direct probe boundary is a narrow repair that preserves explicit values and leaves provider header policy centralized.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c49879668263.

Labels

Label justifications:

  • P2: This repairs provider live-validation requests with limited scope and no demonstrated user-runtime regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate; focused helper checks are reported, but an after-fix OpenCode completion was not independently observed.

Evidence

What I checked:

  • Pinned introduced change: The reviewed diff supplies the fallback immediately before completeSimple, preserves an explicit sessionId with nullish coalescing, and retains the existing timeout signal. OpenAI instruction text is unchanged. (src/agents/models.profiles.live.test.ts:1322, 3eacb2a811e5)
  • Existing transport contract: The canonical header resolver consumes sessionId, restricts generated OpenCode headers to the HTTPS OpenCode host, and preserves explicit model or request headers. The patch uses this existing mechanism rather than adding another header policy. (packages/ai/src/transports/session-affinity.ts:13, c49879668263)
  • Documented distinction between low-level and prepared calls: The provider documentation requires low-level stream callers to supply sessionId. Prepared standalone completions generate their own routing header, but the live suite calls completeSimple directly and does not use that prepared executor. Public docs: docs/providers/opencode.md. (docs/providers/opencode.md:21, c49879668263)
  • Main and release comparison: Inspection of the pinned main and v2026.9.4 live suite found no sessionId supplied at the direct completion call. The branch's stable per-model fallback is therefore still distinct from both inspected versions. (src/agents/models.profiles.live.test.ts:1339, 3a9d69db306c)
  • Related fixes verified merged: GitHub REST confirms fix(opencode-go): attach stable session routing per turn #143558 merged as cde1882 and fix: standalone OpenCode completions lack required routing identity #143659 merged as c061573. Their supplied descriptions and inspected source cover provider turn-state routing and prepared standalone completions, respectively.
  • Proof and review continuity: The captured body lists focused tests and changed-file checks and reports earlier release-validation HTTP 400 failures; it does not claim an observed after-fix live run. The author is MEMBER. The previous completed review retained no findings or published rank-up moves, and the current GitHub review list is empty. The earlier reviewed commit could not be read locally, so no unchanged-code attribution is asserted. (3eacb2a811e5)

Likely related people:

  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-17T02:10:10.560Z sha d03ad46d1358dbdc8a0efb454a0d24d9dd54c1ab :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T02:43:26.450Z sha 1cd49ad :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T05:27:05.287Z sha fea9a7af2c0c0597444b13e7ca7ab357094294ad :: needs maintainer review before merge. :: none

@RomneyDa
RomneyDa force-pushed the fix/frv-opencode-live-session branch 2 times, most recently from 1cd49ad to fea9a7a Compare September 17, 2026 05:18
@RomneyDa
RomneyDa force-pushed the fix/frv-opencode-live-session branch from fea9a7a to 3eacb2a Compare September 17, 2026 06:16
@RomneyDa
RomneyDa merged commit 0763bc7 into main Sep 17, 2026
165 checks passed
@RomneyDa
RomneyDa deleted the fix/frv-opencode-live-session branch September 17, 2026 06:35
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant