Skip to content

fix(sessions): restore dependency checks for pending-input reads - #197839

Merged
steipete merged 2 commits into
mainfrom
fix/2430-pending-input-exports
Nov 12, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/2430-pending-input-exports

Conversation

@steipete

@steipete steipete commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Main's dependency gate still rejects readPendingInputSource, which became an unused export in #184512 (baca36ea403cf681b9ec531c5f27837d0586dcad). Exact parent 74999886c2f98ecaa9c205b220f79bcd5e862371 fails the production scan on that one export. Its production caller is already in the same module; only tests import the raw reader.

User Impact

Restore dependency checks without changing submitted-input reads, replay decisions, or invitation authority. The reader implementation and maintained readSessionSubmittedInput API remain unchanged.

Why This Change Was Made

Make the raw reader private and migrate every test consumer. Four Gateway consumers retain their exact stored-row comparisons through a shared test helper that uses existing store reads and releases the store in finally. Memory tests use the maintained submitted-input API and retain explicit current-window checks.

#184513 merged a real invitation-binder consumer while the earlier revision's CI ran. The final premerge source check caught that change, and the earlier revision was held as a draft. This revision integrates that named owner change and preserves all invitation machinery and retention tests exactly as they appear on the pinned parent. No invitation deletion or new invitation test remains in this PR.

Open #184515 still imports the raw reader in a test; that branch should migrate its test to the maintained reader or the shared test snapshot helper when integrated. Its production invitation feature remains outside this repair.

The final seven-file change has production LOC delta 0 and test/support delta +20. The 23-line test helper serves four existing consumers. No schema, configuration, protocol, or permission change is intended.

Evidence

  • Literal pristine parent 74999886c2f98ecaa9c205b220f79bcd5e862371: production Knip fails with exactly one unused export, readPendingInputSource (59.18 seconds wall; 54.52 seconds user; 32.29 seconds system; 2.95 GB peak RSS). Scanner cost is not a runtime performance benchmark.
  • Fresh independent Codex review of the final seven-file delta: scoped-clean, no actionable P0–P2 findings.
  • Fresh current-base UI proof: eight pending-composer browser cases pass in 3.22 seconds; both selected pending-send handoff E2E variants pass in 27.24 seconds.
  • Fresh current-base consumer proof: 36 Gateway custody/read-scope/retry cases and 10 memory/source cases pass (360.29 seconds including worker compilation); all seven collected-input replay variants pass (30.95 seconds). No assertions or deadlines are loosened.
  • Canonical pnpm check:changed --base 74999886c2f98ecaa9c205b220f79bcd5e862371 passes on the reviewed merge head, including all core/test type graphs and production/full-tree/script export scans with zero entries. The earlier staged-merge attempt resolved the old parent and was stopped; this completed run records the correct parent and seven-file scope.
  • Fresh exact-head CI and hosted review are required for this revision. The earlier fc3ff91a CI/review results are historical and do not qualify this head.

@clawsweeper

clawsweeper Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: M labels Nov 12, 2026
@steipete
steipete marked this pull request as ready for review November 12, 2026 17:23
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

Please review exact head fc3ff91a14cb6a99826ebc34f6547f9b6080c90c. The complete removal preserves the live worker-prepared invitation transaction and prevents pending custody from adopting direct caller invitation options. The body records exact-parent dependency failure, complete consumer migration, successful focused proof, the corrected local typecheck failure, and the open #184513/#184515 integration dependency.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T18:27:21.173220Z b488611 Draft marked ready
ℹ️ 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.

@clawsweeper

clawsweeper Bot commented Nov 12, 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-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Makes the internal pending-input reader private and migrates its test consumers to maintained APIs or a shared snapshot helper.

Example: Run the production dependency scan on parent 7499988.

  • Before: The author reports one unused export: readPendingInputSource.
  • After: The reader remains available to its local production caller without exporting it; existing tests use supported read paths.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-correct; validation is reported in the discussion, with exact-head CI still incomplete.
Proof confidence 🦐 gold shrimp (3/6) This export-visibility and test-consumer repair has no user-visible runtime change; the body reports focused consumer checks and dependency scans, which were not rerun here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Maintenance · Worth it: Yes · Fix scope: Complete
User problem: The production dependency gate rejects an internal reader export with no external production consumer.
Reason: The maintainer-directed repair restores the gate without changing reads, replay decisions, invitation authority, or public APIs.

Merge readiness

✅ Ready for maintainer review

This PR is a focused dependency-check repair with no actionable findings at the requested head; exact-head CI remains pending.

Priority: P3
Reviewed head: b4886112030a91470c40a617fe1ce6beb9436aa3

Before merge

None.

Findings

None.

Agent review details

How this fits together

Session retry comparison accepts a session scope and idempotency key, reads through the durable worker or memory actor, and returns the original submitted message; test-only inspection also exposes retained pending rows.

flowchart TD
  A[Retry comparison] --> B[Submitted input API]
  B --> C[Private source reader]
  C --> D[Durable worker]
  C --> E[Memory actor]
  F[Snapshot test helper] --> G[Existing pending input store]
  G --> D
  G --> E
Loading

Technical review

Best possible solution:

Keep the raw reader private and preserve existing behavioral assertions through the maintained submitted-input API and shared test helper.

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

Source inspection confirms the production caller is local and external imports are test consumers; the author records the exact-parent unused-export failure, but no scanner or tests were run during this read-only review.

Is this the best way to solve the issue?

This is the smallest complete repair: remove the unused export, retain the production implementation, and migrate tests without weakening their distinct custody, retry, and memory-window checks.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Raw submitted-input reader visibility keeps the original intent (5e1ffe9: Moved submitted-source comparisons through bounded worker reads; later invitation integration placed the maintained API in this same module.)
  • Gateway retained-row assertions keeps the original intent (9344233: Preserved ordinary input custody and replay semantics through graceful restart simplification.)
  • Memory continuation assertions keeps the original intent (3de654b: Activated the memory actor as the sole incognito owner, including absent-state and reset-window reads.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 5e1ffe9 adds src/config/sessions/session-pending-input-source.ts:22 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5e1ffe933799; files: src/config/sessions/session-pending-input-source.ts)
  • Vincent Koc: Raw commit baca36e adds src/config/sessions/session-pending-input-source.ts:119 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: baca36ea403c; files: src/config/sessions/session-pending-input-source.ts)

PR surface

Source 0, Tests +20. Total +20 across 7 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 6 58 38 +20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 59 39 +20

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.

Review metrics

Metric Value Why it matters
Production versus test growth Production +1/-1; tests/support +58/-38, net +20. The shared helper serves four existing consumers and preserves retained-row coverage without adding production machinery.

Labels

Label changes:

  • add P3: This repairs dependency-check hygiene while preserving runtime behavior.
  • 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:

  • P3: This repairs dependency-check hygiene while preserving runtime behavior.
  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-12T17:28:56.011Z sha fc3ff91 :: needs maintainer review before merge. :: none

Reviewed November 12, 2026, 1:30 PM ET / 18:30 UTC (Revision 2).

@steipete steipete changed the title fix(sessions): restore dependency checks after invitation cleanup fix(sessions): restore dependency checks for pending-input reads Nov 12, 2026
@steipete
steipete marked this pull request as ready for review November 12, 2026 18:25
@steipete

Copy link
Copy Markdown
Contributor Author
  1. Resolved the premerge HOLD by integrating the named owner change at 74999886c2f98ecaa9c205b220f79bcd5e862371. fix(agents): preserve invitation custody through transcript writes #184513's production binder call in src/sessions/user-turn-transcript.ts:125 and all eight invitation/retention owner files are preserved exactly. The earlier invitation deletion and added invitation test are withdrawn.
  2. The final repair only makes readPendingInputSource private (src/config/sessions/session-pending-input-source.ts:14) and migrates all existing test consumers. The shared snapshot helper (src/config/sessions/session-pending-input-snapshot.test-support.ts:5) retains raw-row assertions with an existing store read and finally release. The exact new parent fails on this one unused export.
  3. Fresh current-base proof covers 53 Gateway/config cases, eight browser cases, and both selected handoff E2E variants. Independent Codex review of the seven-file delta is clean. The body records the current check results; the old head's green CI and review are historical only.

@clawsweeper re-review

Please review exact head b4886112030a91470c40a617fe1ce6beb9436aa3 and the rewritten final-scope body.

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 7602443 into main Nov 12, 2026
202 of 205 checks passed
@steipete
steipete deleted the fix/2430-pending-input-exports branch November 12, 2026 19:03
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

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. gateway Gateway runtime size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant