Skip to content

chore: split four over-cap files that fail changed lint on unrelated PRs - #178874

Merged
jalehman merged 2 commits into
mainfrom
fix/main-max-lines
Oct 21, 2026
Merged

jalehman merged 2 commits into
mainfrom
fix/main-max-lines

Conversation

@jalehman

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a problem where PRs fail the check-lint-core-2 CI job with max-lines errors in files they never touched. Four files on main are over their cap:

  • src/agents/harness/execution-environment.ts: 723 counted lines, cap 700
  • src/agents/code-mode-execution.ts: 701, cap 700
  • src/agents/embedded-agent-runner/run/terminal-preparation.test.ts: 1007, cap 1000
  • extensions/telegram/src/telegram-ingress-coalescing.e2e.test.ts: 1020, cap 1000

The job only fails when a PR's changes make CI lint a whole stripe, so roughly half of open PRs are red on it (for example #177698, #178850, #178849, #178846, #178845, #178843).

Why This Change Was Made

Each file is split along an existing seam, following the line-cap rule (extract a coherent sibling, never trim coverage or disable max-lines):

  • Native tool deny predicates (collectHarnessSafeDeniedToolNames, toolPolicyRestrictsHarnessNativeTools, policyDeniesAllTools) move from execution-environment.ts to a new harness/native-tool-deny-policy.ts.
  • Code Mode wait-run resolution (concurrent-resume, unknown-run and wrong-session checks) moves from runWait into resolveCodeModeWaitRun in code-mode-wait-errors.ts, which already owns those wait errors.
  • The run stats describe block moves to terminal-preparation.run-stats.test.ts. It had been passing only because an earlier describe left the shared payloads mock returning []; the new file mocks payloads explicitly.
  • Two Telegram fixture helpers (spoolBehindPausedPump, expectOnlyPending) replace three repeated test preludes and three repeated queue assertions.

No behavior or assertion changes.

User Impact

None for users. PR CI no longer fails lint on these four pre-existing files.

Evidence

  • node scripts/run-oxlint.mjs on all eight touched files: 0 errors. On main the same four files report the four max-lines errors above.
  • Focused tests pass: Telegram ingress coalescing e2e 22/22, both terminal-preparation files 52/52, src/agents/harness and Code Mode suites (681 tests).
  • tsconfig.core.json and tsconfig.extensions.json typecheck clean.

Move native tool deny predicates and Code Mode wait-run resolution into
sibling modules, the terminal-preparation run-stats tests into their own
file, and repeated Telegram ingress test preludes into fixture helpers.
@clawsweeper

clawsweeper Bot commented Oct 20, 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 channel: telegram Channel integration: telegram agents Agent runtime and tooling size: L labels Oct 20, 2026
@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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR extracts existing agent helpers and reorganizes tests to bring four files under their lint limits.

Example: An unrelated PR triggers linting of src/agents/code-mode-execution.ts.

  • Before: The file has 701 counted lines against a 700-line limit and fails lint.
  • After: Wait-run resolution moves into the existing wait-error module, bringing the original file below its limit.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful mechanical maintenance with preserved behavior, but the newly introduced mock fails an enforced validation gate.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied maintainer-authored designation exempts this behavior-preserving maintenance PR from the ordinary contributor proof gate; no material authority change or persisted-data change requires separate proof.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Maintenance · Worth it: Yes · Fix scope: Complete
User problem: Contributors encounter lint failures in pre-existing files outside their own changes.
Reason: Restoring existing lint limits without suppressions or lost assertions is useful maintenance, and the supplied maintainer-authored designation establishes direction.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this PR provides a focused repair for existing lint failures on main and merits completion.

Priority: P2
Reviewed head: 014dc23fefc85daf3be21363ca7eeeaa224c2113

Before merge

  • Declare isolation for the new payload mock (P2) - The new vi.mock factory replaces a first-party module without passing through its real exports. Its preceding comment lacks the required mock-isolation: prefix, so scripts/lib/mock-factory-scan.mts reports it and check:test-mock-exports fails; the exact-head baseline job confirms that failure. The original file's baseline entry does not cover this new path. Change the adjacent comment to a valid isolation annotation explaining why payload rendering is excluded, or preserve the real exports, without expanding the baseline.

Findings

  • [P2] Declare isolation for the new payload mock — src/agents/embedded-agent-runner/run/terminal-preparation.run-stats.test.ts:13-16
Agent review details

How this fits together

CI lints agent runtime modules and Telegram tests; the extracted helpers retain the same policy inputs, ownership checks, results, and errors.

flowchart TD
  A[Changed PR files] --> B[CI lint selection]
  B --> C[File line limits]
  D[Agent execution] --> E[Extracted policy and wait helpers]
  F[Existing test scenarios] --> G[Sibling suites and fixtures]
  G --> B
Loading

Technical review

Best possible solution:

Keep the mechanical extractions and make the new payload mock comply with the existing export-isolation contract.

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

Source inspection establishes that the new closed mock is rejected by the existing scanner, and exact-head CI reports the matching mock-export failure; no target code was executed.

Is this the best way to solve the issue?

The extractions follow existing responsibility boundaries, remove the replaced implementations, and preserve distinct test scenarios without adding competing state or policy owners.

Full review comments:

  • [P2] Declare isolation for the new payload mock — src/agents/embedded-agent-runner/run/terminal-preparation.run-stats.test.ts:13-16
    The new vi.mock factory replaces a first-party module without passing through its real exports. Its preceding comment lacks the required mock-isolation: prefix, so scripts/lib/mock-factory-scan.mts reports it and check:test-mock-exports fails; the exact-head baseline job confirms that failure. The original file's baseline entry does not cover this new path. Change the adjacent comment to a valid isolation annotation explaining why payload rendering is excluded, or preserve the real exports, without expanding the baseline.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:test-mock-exports --base deb5f80
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit db966d6 adds extensions/telegram/src/telegram-ingress-coalescing-fixture.test-support.ts:94 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: db966d62ae0f; files: extensions/telegram/src/telegram-ingress-coalescing-fixture.test-support.ts)

PR surface

Source +20, Tests +17. Total +37 across 8 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 4 80 60 +20
Tests 4 406 389 +17
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 486 449 +37

Review metrics

Metric Value Why it matters
Production versus test changes Production +80/-60; tests and fixtures +406/-389 Growth is primarily import/export boundaries and isolated test setup; existing runtime logic and assertions are relocated.

Labels

Label changes:

  • add P2: Repairs developer-facing lint failures affecting otherwise unrelated PRs, with no shipped runtime behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Repairs developer-facing lint failures affecting otherwise unrelated PRs, with no shipped runtime behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 October 20, 2026, 8:11 PM ET / October 21, 2026, 00:11 UTC.

@jalehman
jalehman enabled auto-merge (squash) October 21, 2026 13:11
@jalehman
jalehman merged commit 97d6df7 into main Oct 21, 2026
123 checks passed
@jalehman
jalehman deleted the fix/main-max-lines branch October 21, 2026 13:18
@jalehman

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
…PRs (openclaw#178874)

* chore: split four over-cap files so changed lint passes

Move native tool deny predicates and Code Mode wait-run resolution into
sibling modules, the terminal-preparation run-stats tests into their own
file, and repeated Telegram ingress test preludes into fixture helpers.

* test: keep the real payloads module in the split run-stats mock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: telegram Channel integration: telegram P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant