Skip to content

fix(agents): avoid loading transcript storage during model selection - #149079

Merged
vincentkoc merged 5 commits into
mainfrom
fix/startup-model-selection-load-20260915
Sep 16, 2026
Merged

vincentkoc merged 5 commits into
mainfrom
fix/startup-model-selection-load-20260915

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Related: #148962

What Problem This Solves

Model selection loads transcript storage just to resolve a session routing token, pulling an unrelated runtime graph into cold agent startup.

User Impact

Session routing and entry selection stay unchanged. Resolving them no longer initializes the broader transcript storage module; the startup timing improvement still needs measurement.

Why This Change Was Made

The lazy resolver now exports the existing pure helper directly. A regression test rejects loading the broad transcript module while checking explicit-entry precedence, stored-entry fallback, and missing-entry behavior. The obsolete export from the broad transcript facade is removed, and the existing agent-session tests use the retained narrow facade.

Evidence

  • Source and independent integration review confirmed the pure helper and caller contract. Production delta: +3/-5 (net -2); tests: +31/-1. No assertions or timeouts were relaxed.
  • Targeted formatting and git diff --check passed. The export cutover received fresh scoped autoreview with no actionable finding.
  • Previous head 6525b22e4f97710bf94f62e061a1f76cd785b58f: hosted CI observed the new resolver regression passing, transcript sibling tests passing, and the build passing. The aggregate failed, including an unused broad-facade export now repaired here.
  • The previous CI run 35028767101, attached to b0688814d6b0b4ae4a991bd0c5f9174d702dcdbe and tested as merge carrier f81d2a2cc8e688db5e626c5d39d363eb8a394cc8, failed nine PR-wrapper alias fixture cases. Their fake Node executable intercepted dependency materialization before the intended supervisor handoff. The fixture and wrapper inputs were inherited unchanged from main; this job did not establish a transcript-resolver failure.
  • Current source incorporates frozen main 939dd149bced5f6576f5fe4976d9fa8e40cc4b8c, including the canonical alias-fixture composition from fix(ci): restore PR alias delegation checks #149488 and fix(test): restore alias checks after duplicate dependency setup #149477, plus the idempotent helper follow-through in test(gateway): stabilize yielded-session settlement #149558. No duplicate fixture patch was added here. The four-file feature diff is byte-identical after this reviewed integration. Exact-head CI 35049966517, attempt 1 completed successfully: 139 unique jobs, 122 passed and 17 skipped, with no failures. The required CI gate, build and protocol checks passed. Native hosted qualification is the final landing step.
  • The optional baseline poison-import execution remains unrun. Maintainer accepts the source-confirmed import-boundary regression and passing exact-head CI for this landing; no compatible frozen local test install is currently available, and no new install is being introduced solely for this optional control. This is not a claim that the baseline control executed. The original 15-second startup-boundary case failed on the previous head; no claim that this change alone resolves that deadline, and no measured latency or RSS improvement is claimed. This also addresses the review's request to distinguish import isolation from broader startup timing.

Current signed head: bcc1df36ea599153cf8232944a6abbf841fa89fd. The earlier fixture line-cap repair from #149423 remains incorporated. Source review was reused only for the unchanged feature patch; prior failed CI is retained as provenance, not current-head proof. No assertion or timeout change was made.

@vincentkoc vincentkoc self-assigned this Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 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 size: XS maintainer Maintainer-authored PR labels Sep 15, 2026
@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 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 15, 2026, 11:04 PM ET / September 16, 2026, 03:04 UTC (Revision 5).

ClawSweeper review

What this changes

Model selection now imports the existing lightweight session-routing helper directly, removes its redundant storage-facade export, and adds import-isolation coverage.

Merge readiness

⛔ Blocked before merge - 3 items remain

The fix remains useful: current main still loads the broad transcript module through this resolver. No introduced correctness defect was found; the previously requested regression negative control remains unrecorded.

Likely related people: Peter Steinberger and Josh Lehman are low-confidence routing candidates from session-storage history.

Priority: P2
Reviewed head: bcc1df36ea599153cf8232944a6abbf841fa89fd

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable repair with no source defect found and one outstanding regression-validation step.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored internal import repair is exempt from the external-contributor proof gate and changes no authority boundary; supplied tests support resolver isolation, while the related cleanup screenshots do not exercise this path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored internal import repair is exempt from the external-contributor proof gate and changes no authority boundary; supplied tests support resolver isolation, while the related cleanup screenshots do not exercise this path.
Evidence reviewed 9 items Verified introduced patch: The local pinned base-to-head diff matches the supplied introduction evidence: the resolver export changes destination, the broad export is removed, one existing test import moves, and an isolation test is added.
Existing storage-free owner: The complete helper has only a type import and returns the supplied session key plus explicit-entry precedence over the supplied store entry. Its implementation is unchanged, and it neither performs I/O nor depends on a Codex contract.
Production caller and export cutover: Model selection calls the lazy resolver for both stored-session and fallback routing. Repository-wide references identify no remaining caller importing this symbol from the removed broad facade.
Findings None None.
Security None None.

How this fits together

Agent model selection resolves a session routing token and chooses the corresponding session entry before execution. The transcript resolver can perform this step without loading the modules responsible for reading and writing conversation storage.

flowchart TD
  A[Agent command] --> B[Model selection]
  C[Session key and entries] --> B
  B --> D[Lazy transcript resolver]
  D --> E[Existing pure routing helper]
  E --> F[Routing token and selected entry]
  F --> G[Agent execution]
Loading

Before merge

  • Resolve merge risk (P1) - The new isolation regression has reported passing coverage, but its intended baseline failure has not been demonstrated.
  • Resolve merge risk (P1) - Import isolation does not establish a latency improvement or resolution of the separate 15-second startup deadline failure.
  • Complete next step (P2) - Complete the previously requested poison-import baseline negative control and record its intended failing-before, passing-after result in the PR body.
Agent review details

Security

None.

PR surface

Source -2, Tests +30. Total +28 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 3 5 -2
Tests 2 31 1 +30
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 34 6 +28

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep routing resolution with the existing pure helper and load transcript storage only for operations that actually need it.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep routing resolution with the existing pure helper and load transcript storage only for operations that actually need it.

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

Yes, for the unnecessary import: current main's model-selection loader reaches transcript.js through the resolver facade. Source establishes that path; runtime timing and the baseline negative control were not executed in this review.

Is this the best way to solve the issue?

Yes. Redirecting the existing facade to the unchanged pure helper repairs the import boundary without adding another implementation, changing stored settings, or modifying transcript persistence.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded startup import-isolation improvement with unchanged routing semantics and no demonstrated urgent runtime outage.
  • 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: This MEMBER-authored internal import repair is exempt from the external-contributor proof gate and changes no authority boundary; supplied tests support resolver isolation, while the related cleanup screenshots do not exercise this path.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Josh Lehman: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the existing poison-import regression failing on the baseline for the intended reason and passing after the resolver cutover.

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 (4 earlier review cycles)
  • reviewed 2026-09-15T12:43:23.325Z sha 6525b22 :: blocked before merge. :: none
  • reviewed 2026-09-15T21:57:13.772Z sha c79849e :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T22:50:00.714Z sha b068881 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T23:25:43.064Z sha b068881 :: needs changes before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the commands Command implementations label Sep 16, 2026
@vincentkoc
vincentkoc merged commit ef93dfc into main Sep 16, 2026
203 checks passed
@vincentkoc
vincentkoc deleted the fix/startup-model-selection-load-20260915 branch September 16, 2026 03:51
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
…penclaw#149079)

* fix(agents): avoid loading transcript storage during model selection

* fix(agents): complete transcript resolver import cutover
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations 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: XS 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