Skip to content

refactor(ai): remove unused overflow wrapper - #148719

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/test-audit-overflow-dead-wrapper-20260915
Sep 15, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/test-audit-overflow-dead-wrapper-20260915

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Removes an overflow wrapper that has no remaining runtime callers.

User Impact

No user-visible behavior change. The symbol is removed from the reserved internal/runtime subpath, not the public package root or plugin SDK.

Why This Change Was Made

Overflow classification already uses the shared pattern in both assistant-error and failover-explicit scopes. Keep that pattern and every test case; remove only the wrapper and its direct test assertion/import. This removes five production lines and five net test-support lines.

Evidence

  • Normal before/after runs: 25 overflow cases plus 38 classifier cases, all passed with zero failures or skips. All case identities and per-file report order/multiplicity are unchanged.
  • Targeted formatting and all 28 selected changed checks passed. Fresh isolated P2 review is scoped-clean with no findings.
  • Required exact-head CI passed: https://github.com/openclaw/openclaw/actions/runs/34924444695. Both normal CI cohorts executed all 63 retained cases successfully; their labels and per-file order/multiplicity match the local candidate reports.
  • This proves the scoped classification fixtures, not live provider/backend behavior or performance.

@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
@vincentkoc
vincentkoc marked this pull request as ready for review September 15, 2026 03:17
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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: needs maintainer review before merge. Reviewed September 14, 2026, 11:46 PM ET / September 15, 2026, 03:46 UTC (Revision 2).

ClawSweeper review

What this changes

Removes an unused internal overflow-detection wrapper and its redundant test assertion while retaining the shared matching pattern and behavioral tests.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused cleanup with no actionable findings. Current main still contains the unused wrapper, and the retained classifiers and regression cases preserve its behavior.

Priority: P3
Reviewed head: 8e3965426efebc8b4163fc7b645ec5c3cba6f456

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, supported cleanup with preserved behavioral coverage and no identified correctness defects.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored internal cleanup has no runtime behavior change or authority change; retained classifier fixtures and exact-head CI support the deletion without claiming live-provider proof.
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 cleanup has no runtime behavior change or authority change; retained classifier fixtures and exact-head CI support the deletion without claiming live-provider proof.
Evidence reviewed 7 items Introduced change verified: The pinned merge-base-to-head diff removes only the wrapper, its import, and its direct assertion; the configured-context pattern remains in both matching scopes.
Current-main caller search: The complete current-main symbol search found only the definition and its test import/assertion; no runtime callers remain. The reviewed head contains no references.
Internal export contract: The package README explicitly reserves internal subpaths for OpenClaw and disclaims external compatibility guarantees. The runtime barrel exports overflow helpers, whereas the public root does not export this module.
Findings None None.
Security None None.

How this fits together

OpenClaw’s model runtime classifies provider errors and token usage to detect context overflow. Agent recovery and failover consume these classifications to decide how to handle oversized requests.

flowchart LR
  A[Provider error text] --> C[Shared overflow patterns]
  B[Assistant token usage] --> D[Assistant overflow classifier]
  C --> D
  C --> E[Failover classifier]
  D --> F[Agent recovery decisions]
  E --> F
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -5, Tests -5. Total -10 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 0 5 -5
Tests 1 1 6 -5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 1 11 -10

Review metrics

None.

Technical review

Best possible solution:

Keep overflow detection in the existing shared classifiers and remove the unused internal convenience wrapper.

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

Not applicable: this is cleanup, and source searches establish that the removed wrapper has no runtime callers.

Is this the best way to solve the issue?

Yes: removing the unused wrapper while retaining the shared pattern and classifier-level assertions is a narrow, maintainable cleanup.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This removes unused internal code without changing user-visible classification behavior.
  • 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 cleanup has no runtime behavior change or authority change; retained classifier fixtures and exact-head CI support the deletion without claiming live-provider proof.

Evidence

What I checked:

  • Introduced change verified: The pinned merge-base-to-head diff removes only the wrapper, its import, and its direct assertion; the configured-context pattern remains in both matching scopes. (packages/ai/src/utils/overflow.ts:5, 8e3965426efe)
  • Current-main caller search: The complete current-main symbol search found only the definition and its test import/assertion; no runtime callers remain. The reviewed head contains no references. (packages/ai/src/utils/overflow.ts:9, a4790958b284)
  • Internal export contract: The package README explicitly reserves internal subpaths for OpenClaw and disclaims external compatibility guarantees. The runtime barrel exports overflow helpers, whereas the public root does not export this module. (packages/ai/README.md:26, 8e3965426efe)
  • Behavioral coverage retained: Both configured-context test inputs still exercise isContextOverflow; the unchanged failover test independently checks the same provider wording through isContextOverflowError. (src/agents/failover/classify.legacy-provider-predicates.test.ts:66, 8e3965426efe)
  • Shared-classifier history: Current-main history identifies the earlier shared-pattern consolidation. GitHub’s commit patch confirms that consolidation retained the wrapper while adding the shared failover scope. Some historical blobs were unavailable locally; the relevant patch was inspected through GitHub. (packages/ai/src/utils/overflow.ts:73, 90ddeb4b4065)
  • Release still contains wrapper: The latest supplied release, v2026.9.4, still defines the wrapper, as does fetched main; this cleanup has not already landed on either inspected revision. (packages/ai/src/utils/overflow.ts:9, 3a9d69db306c)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • gokay-ai: 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 (1 earlier review cycle)
  • reviewed 2026-09-15T03:22:45.854Z sha 8e39654 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc merged commit 515ff04 into main Sep 15, 2026
192 checks passed
@vincentkoc
vincentkoc deleted the refactor/test-audit-overflow-dead-wrapper-20260915 branch September 15, 2026 03:50
@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 15, 2026
vincentkoc added a commit that referenced this pull request Sep 15, 2026
* commit 'd8e50a38fd1c4df6dd69bcbc155697c464e1be45': (23 commits)
  fix(cron): release queued reservations when activation fails (#141008)
  fix(gateway): reduce CPU work in session lists and searches (#148713)
  feat(gateway): add admin CPU profile diagnostics (#148004)
  fix(gateway): cap device-required probe cache to prevent unbounded growth (#147708)
  fix(ci): align Gateway E2E expectations (#148653)
  refactor(ai): remove unused overflow wrapper (#148719)
  feat: stage selected chat text as editable comments (#148649)
  fix(ci): admit reachable release refs with large histories (#148161)
  fix(agents): allow authorized email CLI actions (#148521)
  improve(agents): trim large tool results with less CPU (#148718)
  refactor(docker): share image version parsing (#148243)
  fix(ci): retain passing hosted checks after skipped duplicates (#148722)
  fix(update): report configuration failures during repair (#144819)
  refactor(imessage): share handle classification (#148229)
  fix(ui): keep the selected agent across Settings pages (#148667)
  test(telegram): reuse deferred fixture helper (#148501)
  fix(media): resize images before understanding (#122431)
  fix: preserve unfinished work during completed PR cleanup (#148704)
  refactor(migrate-hermes): reuse canonical config record coercion (#148645)
  perf(channels): reduce history worker metadata footprint (#148711)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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