Skip to content

perf: reduce repeated CI setup and unnecessary provider discovery - #137612

Merged
steipete merged 6 commits into
mainfrom
codex/reduce-ci-setup-work
Sep 4, 2026
Merged

steipete merged 6 commits into
mainfrom
codex/reduce-ci-setup-work

Conversation

@steipete

@steipete steipete commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

CI repeats setup across core-lint jobs and initializes unrelated provider/browser runtimes in test fixtures. A real-Gateway hovercard test also waits on provider discovery before receiving its missing-agent-owner error. This change removes repeated work while retaining the independent behavior checks.

Why This Change Was Made

  • Ordinary non-frozen hybrid push/PR runs use three core-lint jobs instead of five: existing partitions 1+2, 3+4, and 5. All five Programs, single-thread execution, failure propagation, timeouts, and plugin-lint owners remain. GitHub-only, frozen, manual, and release paths retain five rows.
  • Shared missing-script/file scenarios execute once through the combined source-check group. Six duplicate Bash invocations are removed (26 to 20), retaining command ordering, skip counts, failure markers, standalone successes/failures, and current/frozen routing.
  • Queued-collector fixtures supply their existing browser-cleanup dependency because these collectors own no browser sessions. All 36 collector cases and separate browser-cleanup coverage remain.
  • Talk resolves its existing agent owner before provider discovery. Ambiguous ownership returns the existing INVALID_REQUEST/setup message promptly, including when provider loading would also fail. Valid catalogs and readiness inputs remain unchanged. The real browser test and Gateway cleanup remain intact.
  • Release-evidence fixtures retain all 30 cases and real elapsed-time discovery budgets. The reviewed branch removes the obsolete global CLI clock; main has independently landed that same cleanup in refactor(test): use one clock strategy for candidate reuse fixtures #137938, so it is no longer a unique landing change here.

The branch incorporates main's explicit advisory-service-unavailability warning policy and Chrome MCP preparation fixes. Release-note context for the user-visible Talk latency fix is recorded here; CHANGELOG.md is unchanged, addressing the latest review finding.

User Impact

Developers run the same core-lint coverage with two fewer jobs and avoid repeated fixture setup. Invalid Talk requests report the existing missing-owner error promptly; valid Talk behavior is preserved.

Evidence

Previous native run 33821474677, at head 75d240f, passed all 10 real-Gateway files / 20 unchanged cases. The hovercard case fell from 79.729s to 7.129s, and its Talk owner-error response from 74.656s to 3.125s. The whole real-Gateway job was 8m24s versus 10m15s; main changes and timing variation prevent attributing that complete difference solely to this patch.

A controlled Linux comparison also passed the unchanged hovercard with zero skips: 76.905s to 16.283s, and Talk RPC 61.000s to 2.790s. Both used Node 24.19.0, four actual CPUs, the same reported memory, canonical private builds and cleanup, and 17 verified source files differing only in Talk ordering. Both profiling runners stopped: baseline, candidate.

Prior focused proof includes 473 workflow/oxlint passes with two existing skips; matrix/failure/environment RED/GREEN; all 36 collector and four browser-owner cases; 137 Talk handler/provider/target passes; and a final error-precedence regression that failed before the owner-ordering fix. Full changed-code checks and independent Codex review passed on the prior candidate. After merging main and resolving the fixture conflict, 554 local tests passed: 400 workflow guards (plus two existing skips), 124 Talk/collector cases, and 30 release-candidate cases. Independent Codex review of the complete merged diff is clean for P0–P2. Subsequent formatter-only changes preserve every TypeScript syntax node and literal. Pinned Actionlint, offline Zizmor, Git-owner, composite-input, conflict-marker and formatting checks passed; the canonical workflow wrapper could not install its pre-commit 4.6.2 pin from the available package index. The latest main refresh to 0a1e564d34580935a955c434645103b3fa41a389 preserves the task patch exactly after excluding Git object IDs and hunk offsets. A fresh six-part independent Codex review of the complete candidate is clean for P0–P2, with frozen source and context verified unchanged. The final native CI result is recorded below.

Runtime production: +2/-1 (one moved statement and one comment; executable LOC neutral). Workflow: +19/-9. Tests/support: +169/-86. Docs: +15/-12. No new shards, production configuration, retries, or longer deadlines are introduced by this diff.

CI and Follow-up

Earlier run 33839691185, attempt 1, on head 8c3ae89, finished with 125 successful jobs, nine skips, two unassigned cancellations, and two failures (the npm audit and aggregate gate). The last completed non-Windows job finished 8m22s after workflow creation. Two Node rows never acquired runners and executed no steps, so this is not complete coverage or proof of the eight-minute target. The last job ran for 6m23s after starting 1m59s into the workflow; start delay includes workflow scheduling and must not all be attributed to runner capacity.

All three reduced lint jobs passed and completed by 4m59s from workflow creation. Browser bootstrap passed; the real-Gateway job passed in 6m43s and finished at 7m37s. Both Windows jobs passed (8m31s and 10m29s job duration). The production audit exhausted three 60-second requests; no advisory clearance was obtained. The local audit also failed after three attempts (333.57s overall). Main subsequently landed #137881: ordinary CI explicitly warns when the advisory service is unavailable; known vulnerabilities and malformed or permanent failures still block. This is not advisory clearance.

The one failed-job retry on that exact head completed both previously unassigned Node rows on the existing hosted fallback: 4m45s and 15m35s. The audit again exhausted its requests, so attempt 2 ended with 127 successful jobs, nine skips, and two failures (audit and aggregate gate). No rows remained cancelled. Those fallback durations prove execution, not normal-run latency.

Final normal pull-request run 33843155796, attempt 1, succeeded for head e987726da57d7c2f54b97668334169493522ab7a: 137 jobs, 128 successful and nine unselected skips, with no failures, cancellations, or unassigned selected rows. The run checked synthetic merge 544eb6d5d3cd226e2051c99270ce0bed68e7fadd of that PR head into base 788655a900868fdc9d23d7aec1e0e4efed907e95. Its real-Gateway command therefore includes the newer automation fixture: all 11 files / 21 cases passed.

Non-Windows work completed in 10m09s, above the eight-minute objective. The final compact-large-9 job had a 1m01s dependency/release offset, then 3m12s awaiting assignment, then 5m56s execution. All three lint jobs passed in 4m06s, 3m44s and 1m54s of execution, completing by 5m10s from run creation. Real-Gateway passed in 8m22s; Windows passed in 9m01s and 10m10s. The complete workflow reached its terminal update at 11m21s. These figures separate queue delay from execution and do not establish a provider capacity cause.

The final audit again exhausted three 60-second requests and returned typed exit 2. Main's existing policy emitted an explicit incomplete-audit warning; no advisory clearance was obtained. This green run satisfies the required CI gate, not the eight-minute performance goal or a clean dependency audit.

The real-Gateway declaration build is retained: its private SDK compilation and emitted-output checks are not duplicated by the ordinary artifact job. A follow-up may move that proof to its canonical build owner before optimizing the browser job. Valid Talk transcription discovery still loads unrelated provider runtime code; this patch only avoids discovery for already-invalid requests. The duplicate Telegram Markdown case is handled separately in #137950, retaining its assertions in the stronger adjacent test. Codex test teardown also repeatedly launches production session reclamation; replacing it with owned temporary-state disposal needs proof that nested database handles are all drained and closed before removing that work.

@steipete steipete self-assigned this Sep 3, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Sep 3, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 4, 2026, 2:16 AM ET / 06:16 UTC.

ClawSweeper review

What this changes

The branch consolidates ordinary hybrid core-lint work into three hosted jobs, removes repeated test setup, and validates Talk ownership before provider discovery.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open. The branch remains necessary: current main still resolves the Talk owner later, and the CI workflow change has not yet completed native CI on the exact head.

Priority: P3
Reviewed head: e987726da57d7c2f54b97668334169493522ab7a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has focused source and regression coverage with no confirmed correctness defect, but exact-head native CI must still complete.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository State identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply; supplied native evidence is supplemental, while exact-head CI remains a separate merge gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository State identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply; supplied native evidence is supplemental, while exact-head CI remains a separate merge gate.
Evidence reviewed 6 items Introduced CI topology preserves coverage: The introduced hybrid matrix has three rows, expands them to core stripes 1–5, and skips only the synthetic sixth stripe; the guard test exercises both push and pull-request mappings plus failure propagation.
Talk ordering is a narrow precedence change: The branch moves the existing unconditional owner resolver before provider discovery. Current main still contains the same resolver later in catalog construction, so the PR is not already implemented there.
Talk behavior and documentation agree: The handler maps owner-selection errors to INVALID_REQUEST, while the documentation describes catalog model discovery and the added prompt owner check; existing session tests separately retain keyless transcription behavior.
Findings None None.
Security None None.

How this fits together

CI preflight selects lint-job topology before GitHub Actions runs the repository checks. Gateway Talk serves provider catalogs to voice and transcription clients, and its catalog construction determines which configuration error is returned first.

flowchart LR
  A[Push or pull request] --> B[CI preflight]
  B --> C[Core lint job planner]
  C --> D[Five lint programs]
  E[Talk catalog request] --> F[Talk ownership check]
  F --> G[Provider discovery]
  G --> H[Catalog response]
Loading

Before merge

  • Resolve merge risk (P1) - The CI matrix and shell expansion are changed, but native CI for the exact head is still incomplete, leaving real GitHub Actions evaluation and aggregate-gate behavior unverified.
  • Complete next step (P2) - Obtain a complete green native CI result for head e987726 before merge.
Agent review details

Security

None.

PR surface

Source +1, Tests +83, Docs +3, Config +10. Total +97 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 1 +1
Tests 4 169 86 +83
Docs 2 15 12 +3
Config 1 19 9 +10
Generated 0 0 0 0
Other 0 0 0 0
Total 8 205 108 +97

Review metrics

Metric Value Why it matters
Production versus validation delta runtime executable +0; workflow +10 net; tests/support +83 net; docs +3 net The only runtime executable change is a moved resolver; most growth is workflow coverage and regression support.
Hybrid lint topology 5 programs across 3 ordinary hybrid jobs, from 5 jobs The intended performance gain depends on serial pairing preserving every core lint program exactly once.

Merge-risk options

Maintainer options:

  1. Complete exact-head native CI (recommended)
    Wait for a complete green native run on the current head so the changed matrix and shell expansion are exercised by GitHub Actions.
  2. Pause the performance change
    Pause this PR if native CI cannot complete, rather than merging an unverified CI topology change.

Technical review

Best possible solution:

Retain the five-program coverage and land after a complete green native CI run validates the exact current head.

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

Not applicable: this is a performance and CI-topology PR rather than an unresolved bug report; its affected paths have source and prior native-run evidence.

Is this the best way to solve the issue?

Yes. The implementation preserves the five lint programs while reducing ordinary hybrid setup, and moves an already-required Talk ownership check ahead of costly provider discovery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ddad3eccc539.

Labels

Label justifications:

  • P3: This is a bounded CI and request-path performance improvement with no confirmed user-facing regression.
  • merge-risk: 🚨 automation: The PR changes GitHub Actions matrix and shell behavior, and complete exact-head native CI is not yet available.
  • 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: Repository State identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply; supplied native evidence is supplemental, while exact-head CI remains a separate merge gate.

Evidence

What I checked:

  • Introduced CI topology preserves coverage: The introduced hybrid matrix has three rows, expands them to core stripes 1–5, and skips only the synthetic sixth stripe; the guard test exercises both push and pull-request mappings plus failure propagation. (.github/workflows/ci.yml:3724, e987726da57d)
  • Talk ordering is a narrow precedence change: The branch moves the existing unconditional owner resolver before provider discovery. Current main still contains the same resolver later in catalog construction, so the PR is not already implemented there. (src/gateway/server-methods/talk.ts:249, ddad3eccc539)
  • Talk behavior and documentation agree: The handler maps owner-selection errors to INVALID_REQUEST, while the documentation describes catalog model discovery and the added prompt owner check; existing session tests separately retain keyless transcription behavior. (src/gateway/server-methods/talk.ts:757, e987726da57d)
  • Relevant feature history: The current Talk ownership surface was introduced by the merged Talk-owner fix; the branch’s performance commit is authored by the same recent area contributor. (src/talk/agent-target.ts:8, 381b5e41ee6e)
  • Direct Codex boundary check: Direct inspection of the sibling Codex checkout found unrelated temporary-session cleanup only; no introduced hunk imports, executes, or relies on that runtime contract. (41e22fee981a63b3698df7ed36bad393cda24715)
  • Exact-head CI remains incomplete: The supplied exact-head check rollup contains queued and in-progress native jobs, so the changed Actions matrix has not yet received a complete green run. (e987726da57d)

Likely related people:

  • steipete: 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.

  • Obtain a complete green native CI result for e987726.

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 (6 earlier review cycles)
  • reviewed 2026-09-03T22:39:00.009Z sha 6d05ca9 :: blocked before merge. :: none
  • reviewed 2026-09-03T23:06:19.596Z sha 3e11e24 :: blocked before merge. :: none
  • reviewed 2026-09-04T00:34:47.632Z sha 75d240f :: blocked before merge. :: [P2] Remove the release-owned changelog entry
  • reviewed 2026-09-04T01:09:50.968Z sha 75d240f :: blocked before merge. :: [P2] Remove the release-owned changelog entry
  • reviewed 2026-09-04T05:20:43.042Z sha 8c3ae89 :: blocked before merge. :: none
  • reviewed 2026-09-04T05:37:26.151Z sha 8c3ae89 :: blocked before merge. :: none

@steipete steipete changed the title improve: reduce CI setup and unrelated test work perf: reduce repeated CI setup and unnecessary provider discovery Sep 4, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the agents Agent runtime and tooling label Sep 4, 2026
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The final head is 75d240f. It adds early Talk catalog owner validation and removes six duplicate workflow-test executions. The unchanged Linux real-Gateway case passed in 16.283s versus 76.905s with the same source fixture, assertions, Node version and hardware; the PR body records the limits and proof. Independent Codex P0–P2 review is clean, including the resolved main overlap, and all 132 selected merged owner tests passed.

The prior rank-up request to finish Windows was satisfied on 3e11. Final-head CI is running at https://github.com/openclaw/openclaw/actions/runs/33821474677; the production audit has again hit its 60-second advisory timeout and test-job failures are being investigated. This is a review refresh, not a request to waive CI or start repair/automerge.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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 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 4, 2026
@clawsweeper clawsweeper Bot added 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. and removed 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. labels Sep 4, 2026
@steipete
steipete merged commit fa38d78 into main Sep 4, 2026
208 checks passed
@steipete
steipete deleted the codex/reduce-ci-setup-work branch September 4, 2026 06:28
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…enclaw#137612)

* ci: reduce repeated CI and fixture setup

* test: keep release candidate CLI fixtures valid

* perf: avoid redundant provider discovery and workflow test work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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