Skip to content

chore(ci): diagnose session facts read failures - #200472

Closed
vincentkoc wants to merge 4 commits into
mainfrom
chore/diagnose-session-facts-20261117
Closed

vincentkoc wants to merge 4 commits into
mainfrom
chore/diagnose-session-facts-20261117

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Diagnostic only — do not merge

Linux CI intermittently rejects chat.send with SESSION_MUTATION_AUTHORIZATION_CHANGED before returning its run ID. The latest reproduction tested merge 383b8ce6e74e9c386572d5651734341679158262 from this candidate and main. xAI failed after 26.647 seconds; all five recovered-output cases passed.

The trace identifies a known committed upsert with the current schema. Its registry filter had entries but no prepared source, and never evaluated physical generation. This is not evidence of a replacement file or unknown settlement. A local control confirms that forwarding first-use registration through the retained authorization preserves absent facts; a later local origin probe traced the direct registrations to nonempty model catalog saves. Catalog persistence can create the same agent database after the fixture captures its absence, so invalidation is legitimate.

The probe records rejected registry-transition categories and mutation kinds, plus booleans describing existing physical-generation and prepared-source checks. It observes those checks without repeating filesystem calls. Existing invalidation reasons and the two incident tests' entry markers remain.

Authorization, guard order, invalidation assignment, waits, fixtures, assertions, and error propagation remain unchanged. Logs contain no paths, identities, configuration, or message content.

Validation: targeted lint, formatting, file-size ratchet, core typecheck, diff checks, and complete independent review with both full owner modules passed. This remains temporary diagnostic code, not a production fix.

The fixture repair is tracked in #200495: settle all 18 scenario catalogs before subscription and send, using the existing owner contract. Local exact-case proof and static checks pass; exact Linux CI confirmation is pending.

@clawsweeper

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

@vincentkoc vincentkoc self-assigned this Nov 17, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Nov 17, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 17, 2026 07:10
@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. labels Nov 17, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. 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 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR adds diagnostic logging around session-facts invalidation and rejected database-registry transitions.

Example: A committed database-registration upsert invalidates facts retained for chat.send.

  • Before: The request fails with SESSION_MUTATION_AUTHORIZATION_CHANGED without identifying which registry checks ran.
  • After: The request still fails, while diagnostic output records the transition category, mutation kind, and generation-check booleans.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, behavior-preserving instrumentation with an observed target failure; useful for investigation and intentionally held from merging.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored diagnostic change has no intended user-facing behavior change; CI confirms execution of the targeted failure path, while detailed redirected logs were inaccessible to this review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Maintenance · Worth it: Yes
User problem: Some chat requests are rejected before receiving a run ID, and existing errors do not isolate the responsible registry transition.
Reason: Maintainer-authorized temporary diagnostics provide useful investigation evidence while preserving the existing product contract and explicit merge hold.

Merge readiness

✅ Ready for maintainer review

Keep open as a maintainer-owned diagnostic investigation and honor its explicit do-not-merge instruction; no actionable defect was found in the introduced tracing.

Priority: P2
Reviewed head: b3af8b0ad0f842ec40a284d4993e3e457865157d

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway session preparation captures storage and sharing facts, checks registry publications, and supplies retained authority to session mutations; the added logs describe existing rejection paths.

flowchart TD
  A[chat.send request] --> B[Session facts preparation]
  B --> C[Database registry witness]
  C --> D[Source mutation filter]
  D --> E[Existing authorization result]
  B --> F[Diagnostic output]
  C --> F
  D --> F
Loading

Technical review

Best possible solution:

Use the diagnostic results to identify the rejected registration, then replace temporary tracing with a focused repair through the existing registry and session-facts owners.

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

CI annotations confirm the target authorization error on this candidate; no current-main reproduction was run, and this diagnostic PR claims no repair.

Is this the best way to solve the issue?

The tracing is appropriately scoped for investigation: it observes existing checks without adding filesystem probes, weakening assertions, or changing authorization decisions.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Registry mutation filtering keeps the original intent (9fc095c: Retain complete committed session facts and physical-source ownership across background publication; the probe preserves these decisions.)
  • Physical-generation checks keeps the original intent (2c4413a: Move necessary I/O through existing owners while preserving physical replacement checks; instrumentation wraps the existing calls without repeating them.)
  • Retained session-facts invalidation keeps the original intent (65e49fa: Bind deferred work to its original requester authority; added reason labels leave invalidation and error propagation intact.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Explicit diagnostic hold: The current body says “Diagnostic only — do not merge” and explicitly describes temporary instrumentation rather than a production fix; GitHub confirms MEMBER authorship and the reviewed head. (b3af8b0ad0f8)
  • Introduced behavior: The pinned introduction diff adds rejection logs, invalidation reasons, test-entry markers, and observation of existing generation checks without changing their short-circuit order or return values. (src/config/sessions/session-store-target-inventory.ts:348, b3af8b0ad0f8)
  • Observed target failure: The failing CI annotation records chat.send rejecting with SESSION_MUTATION_AUTHORIZATION_CHANGED. Full job logs redirect to a blocked storage host, so the body's detailed diagnostic trace could not be independently inspected; this does not establish a patch-caused failure. (b3af8b0ad0f8)
  • Current-main boundary and ownership: Fetched main retains the original registry filter and invalidation behavior. Feature history identifies Peter Steinberger's sustained work across registry snapshots, retained session facts, and worker discovery; blame verifies an authored line at the current-main revision. (src/config/sessions/session-store-target-inventory.ts:353, 96763b979fed)
  • Related repair remains distinct: fix: prevent startup refusals in chat and queued model discovery #200147 investigates first-chat authorization refusal during catalog persistence; fix(gateway): allow first database creation during session discovery #199862 explicitly leaves the separate authorization failure unresolved. Neither establishes the cause of this candidate's failed request.
  • Review scope and limits: Read the complete root and applicable Gateway AGENTS.md, all changed modules, retained test scenarios, and simplification guidance. No maintainer-notes directory exists. Historical content searches encountered unavailable promisor objects; metadata history and relevant blame remained usable. The checkout is clean. (AGENTS.md:1, b3af8b0ad0f8)

PR surface

Source +41, Tests +4. Total +45 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 56 15 +41
Tests 2 4 0 +4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 60 15 +45

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: The probe supports investigation of a concrete chat-admission failure observed in CI, without establishing an urgent deployed-user regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The probe supports investigation of a concrete chat-admission failure observed in CI, without establishing an urgent deployed-user regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 17, 2026, 3:08 AM ET / 08:08 UTC.

@vincentkoc

Copy link
Copy Markdown
Member Author

Superseded by #200495, merged as 8d0f33f. The exact Linux xAI case passed after the fixture waited for catalog persistence. The production invalidation contract is unchanged; this temporary diagnostic branch will not be merged.

@vincentkoc vincentkoc closed this Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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