Skip to content

fix: keep session assessments working with ChatGPT token sharing - #196344

Open
jason-allen-oneal wants to merge 2 commits into
openclaw:mainfrom
jason-allen-oneal:fix/observer-preferred-sampling
Open

jason-allen-oneal wants to merge 2 commits into
openclaw:mainfrom
jason-allen-oneal:fix/observer-preferred-sampling

Conversation

@jason-allen-oneal

@jason-allen-oneal jason-allen-oneal commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Related: #175646

What Problem This Solves

Fixes: session assessments fail before inference on ChatGPT token-sharing routes because the observer's internal token and temperature defaults are treated as mandatory limits.

User Impact

The observer can use the selected ChatGPT token-sharing credential without switching runtimes, accounts, endpoints, or billing routes. API-key calls keep the existing sampling limits. Explicit caller-required limits remain strict and are still rejected before inference when unsupported.

Why This Change Was Made

Carry the distinction between preferred internal defaults and required sampling limits through the existing isolated-completion contract. The observer marks its hardcoded defaults as preferred; Codex omits them only after resolving an actual token-sharing credential. Other calls keep strict behavior unless they opt into that intent. This adds no configuration option, new authentication path, or permission bypass.

The dependency contract was re-inspected at Codex 633ab199cfd724aa78013c006b27a2b3d049fc3b (the retained execution proof used the earlier pinned source): the native Responses request does not carry these sampling fields. The existing token-sharing rejection remains in place for strict requests.

Evidence

  • November 11 candidate: 191a6937efd18ff868472e412fcd725ca18b6456, tree f70e02fa56e3308eec681a35aa43a72d991c2863. Independent native review found no actionable mechanical-conflict or clock-fixture defect. Both new performance-clock spies use scoped using resources; dedicated deadline tests retain advancing clocks and verify expiry, cancellation, cleanup and retry budgets. Production deadlines are unchanged. New-head hosted CI remains pending.

  • Current-main integration: merged ae651f116c7713295d6969b36bb1762ee0196edc, retaining opt-in preferred sampling beside upstream invalid-output classification, fallback deadlines and physical work settlement. Independent review found no conflict-resolution defect. Core and extension types, focused production/test lint, formatting, the test-line allocation check and observer preparation (8 checks) passed. The repaired native API-boundary suite passed 13 checks; the budget/deadline suites passed 31 checks. This is integration verification, not a repeat of the retained real-grant execution.

  • Test-fixture correction: the harness-v2 budget case hit its inherited one-second deadline during cold module loading. The token-budget suite and API-boundary sampling table now use the existing monotonic-clock spy pattern (the API-key fixture likewise hit its inherited five-second deadline during cold loading); the request timeout and production deadline implementation are unchanged. The budget/deadline run passed all 31 checks; deadline behavior remains checked with an advancing clock.

  • Retained execution proof on original candidate 16d08c5bc9b39a67aa539e2da12a646e98421fec. Real-grant Gateway execution, upgrade receipts, controls and limitations.

  • Actual Gateway + real SIWC grant: four model-written observer assessments during a successful 61.8-second session, then persisted done state. OpenClaw/Sol drives ordinary activity; Codex/Luna performs the observer assessments. The real grant was obtained through supported stable sign-in; no production credential was copied and no provider response was mocked in this scenario.

  • Latest-stable upgrade: official npm 2026.11.2 → exact candidate through canonical Doctor migration, same isolated state. Account/profile identity and utility model preserved; retained session ID/provider/model/runtime and transcript payloads match. Ordinary Codex-primary turns hit the same separate prepared-API-key support rejection on both builds; the successful observer scenario uses a new OpenClaw-primary session. This is not an identical primary-workload red/green comparison.

  • Controls: same real grant + explicit 37-token/temperature-0 limits rejects before native launch. Actual managed Codex 0.164.0 preserves 300/0.2 and 37/0 in two physical TLS WebSocket API-key requests. These controls use the built harness API; API-key credentials/receiver output are synthetic. The artifact discloses the PID-observation limit and all failed setup attempts.

  • Prior native synthetic proof remains historical evidence. Boundary tests: 13 passed; removing the repair fails only the preferred token-sharing case. Budget propagation: 7 passed; prefix stability: 14 passed. Core typecheck, focused lint/formatting, import inventory and package-boundary compilation passed; exact-head CI was green for the original candidate, not this new integration head.

  • The original candidate's independent read-only code review found no actionable P0–P2 findings. CLI autoreview was unavailable due to authentication failure; no successful CLI review is claimed.

Owner decision remains open: accept the narrow opt-in advisory contract while keeping omitted-mode callers strict. The evidence does not claim that this decision has been approved.

Real provider inference and Gateway runs above were confined to the isolated proof profile. No production Gateway/configuration change, merge or deployment was performed. Runtime deadline, malformed-output recovery and the separate ordinary Codex support gate are outside this PR.

@clawsweeper

clawsweeper Bot commented Nov 10, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling extensions: codex size: S labels Nov 10, 2026
@jason-allen-oneal
jason-allen-oneal marked this pull request as ready for review November 10, 2026 00:26
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 16d08c5bc9b39a67aa539e2da12a646e98421fec, but the PR head is now 191a6937efd18ff868472e412fcd725ca18b6456. Its old verdict and PR readiness labels are no longer current.

Next step
Comment @clawsweeper re-review when the current head is ready; pushes after the first review are not reviewed automatically.

Review history (3 earlier review cycles)
  • reviewed 2026-11-10T00:43:47.453Z sha 16d08c5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-10T00:57:18.586Z sha 16d08c5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-10T05:55:58.218Z sha 16d08c5 :: ready, awaiting a maintainer decision. :: none

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@roboclaw-bot roboclaw-bot added the clawtributors PR from a clawtributor label Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. labels Nov 19, 2026
@brandon-julio-t

Copy link
Copy Markdown
Contributor

Heads-up for coordination: #208733 uses the same streamParamsMode: "preferred" contract from this PR for the remaining native-subscription branch reported in #204135 (Codex launched from a configured appServer.command, so no relay owner). It leaves the ChatGPT token-sharing branch here untouched, so the two should compose; whichever lands second only needs a small rebase on the shared field.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawtributors PR from a clawtributor docs Improvements or additions to documentation extensions: codex gateway Gateway runtime P2 Normal backlog priority with limited blast radius. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants