Skip to content

fix(ci): prevent stale checks from rejecting valid changes - #169616

Merged
RomneyDa merged 1 commit into
mainfrom
fix/shared-owner-fixtures-20261011
Oct 12, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/shared-owner-fixtures-20261011

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes valid PRs failing CI because shared native, channel, and Memory fixtures and two internal exports no longer follow their current owners.

User Impact

CI exercises the intended contracts again. There are no user-facing runtime, schema, configuration, permission, dependency, or public API changes.

Why This Change Was Made

Keep fixture identities, async routing, published TTLs, and offline Memory mutations aligned with production ownership. Existing transcript refusal, routing, expiry, keyword fallback, and model-mismatch assertions remain intact. Main's existing Matrix cold-corruption repair is retained, not duplicated. Delete an unused internal reply predicate and make the internally called reader-retirement helper private; its corruption handling is unchanged.

This is a separate red-main fixture repair, not part of the plain-language PR scopes. Repository rules already refused a direct main push, so it follows the native PR landing path.

Evidence

The failures were reproduced without wording changes on the exact tested main 48d96b4e3b6f2bd79583e0fac438ab91a3cd57c7:

Selection Before After repair on qualified main
Native finalizer Four ordinary variants fail the writer-scope guard; hidden variant passes 12/12 owner and caller cases pass; guards unchanged
Feishu and Matrix Four routing/notice failures and two Matrix fixture failures 97/97 cases pass; one Matrix failure was already fixed by main
Memory caller shard Persisted-mismatch case fails; 149 cases pass 150/150 cases pass
Reader ownership Retirement export has only an in-module caller 65/65 existing ownership/cleanup cases pass after making it private

The five fixture files were qualified against e03a56d942364c94bd82e74fc3184f7ebcb8b4af. Its updated logical-expiry owner passes the existing Matrix TTL case (13 explicitly unselected), and both Memory transport/mismatch cases pass after the database-lifecycle changes. Unchanged earlier proof was reused. The first changed-gate attempt found two missing names in main's unchanged deletion-journal phase guard; main independently fixed that owner in 21a1699fbce, which is included in the final base 3d9595fe12769ce63cb54992911728b95442e243. Extension test types then passed.

Independent autoreview of the final seven-file delta is scoped-clean at P0–P2. The required production and full-tree unused-export scans first reproduced two main-only leftovers; whole-repository references confirmed the dead predicate has no callers or SDK surface, while reader retirement has a live internal caller that is preserved. The full combined changed-file gate passes: all core/test/extension type graphs, three unused-export scans, scoped lint, boundary/ratchet, schema, cycle, and auth guards (751.80 seconds). Exact-head hosted CI and ClawSweeper remain separately enforced.

The separate anonymous chat-row failure was investigated in the original file order: the full 88-case Gateway selection passes with unchanged Gateway/session sources. No Gateway repair or flake-resolution claim is included.

Commands and measured local cost

All proof uses the repository runner, synthetic providers, isolated state, and one worker. No live Gateway or provider is used.

node scripts/run-vitest.mjs extensions/codex/src/app-server/settled-turn-finalizer.native.test.ts extensions/codex/src/app-server/run-attempt.model-attribution.test.ts extensions/codex/src/app-server/run-attempt.steering-settlement.test.ts --maxWorkers=1 --configLoader runner
node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-database-workers.config.ts extensions/feishu/src/feishu-ingress.test.ts extensions/feishu/src/doctor.test.ts extensions/feishu/src/monitor.dedupe-lifecycle.test.ts extensions/feishu/src/monitor.post-replay.test.ts extensions/feishu/src/monitor.helpers.test.ts extensions/feishu/src/monitor.lifecycle.test.ts extensions/matrix/src/matrix/sdk/recovery-key-store.test.ts extensions/matrix/doctor-contract-api.test.ts extensions/matrix/src/matrix/sdk/idb-persistence.test.ts
node scripts/run-vitest.mjs run extensions/memory-core/src/tools.local-fallback.test.ts --maxWorkers=1

Measured local wall time: Native owner/caller selection 100.82 seconds; combined Feishu/Matrix selection 147.98 seconds of Vitest duration; final Memory file 26.51 seconds, then 33.52 seconds on the latest qualified base. The original Memory ten-file selection passes in 114.62 seconds. Current-owner Matrix TTL qualification takes 35.90 seconds, with the case itself 629 ms; reader ownership's three-file selection takes 36.04 seconds. Worker preparation and cold module transformation dominate these existing integrations; no new timers, sleeps, retries, test cases, or production test seams were added. Hosted CI seconds will be recorded when available.

@clawsweeper

clawsweeper Bot commented Oct 12, 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: matrix Channel integration: matrix extensions: memory-core Extension: memory-core agents Agent runtime and tooling channel: feishu Channel integration: feishu extensions: codex size: S labels Oct 12, 2026
@RomneyDa
RomneyDa marked this pull request as ready for review October 12, 2026 05:00
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR aligns existing test fixtures with their production owners and removes unused internal exports.

Example: Run ordinary Codex finalization with session key agent:main:settled-native.

  • Before: The fixture targets agent main without consistently setting the run's agentId, causing the transcript writer guard to reject it.
  • After: The shared fixture sets agentId to main while preserving the writer guard.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, source-supported maintenance with retained behavioral coverage; available validation is harness-based and was not rerun in this review.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored fixture repair supplies harness validation for native finalization, channel routing, expiry, and Memory fallback; its production edits only remove unused export surface.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Maintenance · Worth it: Yes · Fix scope: Complete
User problem: Valid contributions fail CI because fixtures and unused-export checks no longer match current production ownership.
Reason: This maintainer-authored repair restores useful checks without changing product defaults, public APIs, or production behavior.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs concrete fixture drift still present on fetched main, and review found no actionable introduced defect.

Priority: P2
Reviewed head: 1d54e06b66a770e3c99472c4aa72d46020b84c78

Before merge

None.

Findings

None.

Agent review details

How this fits together

CI fixtures feed synthetic sessions, routes, expiry records, and embedding failures through production owners, then assert transcript, routing, retention, and search outcomes.

flowchart TD
A[CI test runner] --> B[Shared fixtures]
B --> C[Codex transcript owner]
B --> D[Feishu routing owner]
B --> E[Plugin state owner]
B --> F[Memory search owner]
C --> G[Behavior assertions]
D --> G
E --> G
F --> G
Loading

Technical review

Best possible solution:

Land the focused fixture repair through the existing merge gates while preserving production ownership and behavioral assertions.

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

Source confirms the stale Feishu mock target and inconsistent Codex fixture identity; the PR records failing-before and passing-after selections, which this review did not rerun.

Is this the best way to solve the issue?

The repair updates fixture producers and uses existing lifecycle and mutation owners while retaining the relevant negative assertions.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Codex session fixture and hidden-turn setup keeps the original intent (03e4bc0: The shared helper establishes a main-agent SQLite session target; moving the hidden variant's agentId assignment into that helper completes the same fixture identity.)
  • Feishu binding-route fixture keeps the original intent (474dc99: fix(channels): resolve bound agents before ordinary selection #159533 explicitly retains Feishu's completed-route contract; this patch preserves that refusal while correcting the SDK mock target.)
  • Matrix retention fixture keeps the original intent (505d7b9: fix(matrix): migrate dedupe from legacy state databases #113487 preserves imported marker age and remaining TTL; those assertions remain intact while expiry is published through its owner.)
  • Memory fallback and model mismatch keeps the original intent (05f7473: fix(memory): keep keyword fallback when the embedding provider fails mid-session #152210 requires keyword fallback during embedding failures and rejection of genuine model mismatches; both outcomes remain asserted using the current manager lifecycle.)
  • Unused visible-reply predicate keeps the original intent (3cdbe3a: The predicate supported model-verification answer checks; its canonical extractor remains, and the predicate has no remaining callers or SDK exposure.)
  • Reader corruption retirement keeps the original intent (34cb8f7: The reader owner must retire corrupt readers; making its internally called helper private preserves the implementation and caller.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Verified introduction and current-main comparison: The pinned introduction contains only the stated fixture repairs and internal-export cleanup; fetched main retains the pre-repair versions of the affected files. (1d54e06b66a7)
  • Fixture identity and routing match production: The Codex helper now supplies the same agent identity as its session target; Feishu's mock now intercepts the conversation-binding-runtime async function actually consumed by bot.ts. (extensions/codex/src/app-server/sqlite-session.test-helpers.ts:14, 1d54e06b66a7)
  • Expiry remains independently asserted: The Matrix test retains its original creation-time, remaining-TTL, live-lookup, and expired-lookup assertions; its replacement import uses the existing mutation owner, which invalidates published state and computes the injected deadline. (extensions/matrix/doctor-contract-api.test.ts:614, 1d54e06b66a7)
  • Memory mismatch coverage survives lifecycle repair: Keyword fallback is asserted before closing the manager; persisted model corruption is then written offline and checked through a subsequent tool invocation. Manager close removes the old registry entry. (extensions/memory-core/src/tools.local-fallback.test.ts:51, 1d54e06b66a7)
  • Internal cleanup preserves behavior: Whole-tree references show no remaining caller of agentRunHasVisibleReply and only an in-module caller of reader retirement; the latter's invalidation and corruption bookkeeping remain unchanged. (src/state/openclaw-state-db-read-connection.ts:90, 1d54e06b66a7)
  • Codex dependency contract inspected directly: The native test fixture executes the pinned Codex app-server, making its protocol relevant. The sibling checkout's root policy and thread/start and turn/start definitions were inspected; this patch changes neither protocol. Its GitHub repository identity could not be independently verified. (codex-rs/app-server-protocol/src/protocol/v2/thread.rs:62, a956835d020762cb2b570053af06f643a11c0ecc)

Likely related people:

  • Peter Steinberger: Raw commit 34cb8f7 adds src/state/openclaw-state-db-read-connection.ts:93 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 34cb8f754344; files: src/state/openclaw-state-db-read-connection.ts)
  • synth: Raw commit 05f7473 adds extensions/memory-core/src/tools.local-fallback.test.ts:26 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 05f7473e9ddb; files: extensions/memory-core/src/tools.local-fallback.test.ts)

PR surface

Source -4, Tests +4. Total 0 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 1 5 -4
Tests 5 41 37 +4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 42 42 0

Review metrics

Metric Value Why it matters
Production versus test changes Production +1/-5; tests and fixtures +41/-37 Production shrinks while existing fixtures are repaired without adding test cases.

Labels

Label changes:

  • add P2: Stale fixtures reject valid contributions, but this patch addresses no demonstrated user-facing runtime outage.
  • 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:

  • P2: Stale fixtures reject valid contributions, but this patch addresses no demonstrated user-facing runtime outage.
  • 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.

Reviewed October 12, 2026, 1:06 AM ET / 05:06 UTC.

@RomneyDa
RomneyDa merged commit 1f5c145 into main Oct 12, 2026
214 checks passed
@RomneyDa
RomneyDa deleted the fix/shared-owner-fixtures-20261011 branch October 12, 2026 05:15
@RomneyDa

Copy link
Copy Markdown
Member Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 12, 2026
The ClawRouter pool dashboard (#169514) exported ClawRouterPoolTraffic, but
nothing imports it: control-ui.tsx derives the same shape through
ClawRouterPool["usage"]["lanes"][number]. The Knip production and full-tree
unused-export scans therefore fail for every change on main, which breaks the
dead export scan in scripts/check-changed.mjs. The type stays file-local
because pool.ts still uses it for the usage field and the traffic() parser.

The previously reported agentRunHasVisibleReply finding was already removed
by #169616; this was the remaining entry.

Proof: node --import tsx scripts/check-deadcode-exports.mts passes all three
scans with 0 entries (main at f466872 failed with only this symbol);
pnpm tsgo:core and pnpm tsgo:extensions clean; oxlint clean;
pnpm test extensions/clawrouter/pool.test.ts --maxWorkers=1 passes (5.3s).
MarMarLabs added a commit to MarMarLabs/openclaw that referenced this pull request Oct 12, 2026
299 upstream commits, seven of them touching extensions/feishu (none
overlap the branch's files). runtime-forwarders.ts and the config baseline
hash file conflicted.

openclaw#169375 made createRuntimeOutboundDelegates read each method once instead
of re-reading the params on every call. The merge takes that shape and
adds the branch's sendFormattedText to the OutboundMethod union and to the
returned delegates, so Feishu still advertises the formatted sender on the
registered surface. Upstream's updated forwarder test is kept, with the
branch's sendFormattedText: undefined row.

The config baseline hashes were regenerated from this merge with
build:docker in a separate detached checkout. Counts are unchanged at core
2499, channel 4033 and plugin 4527, since upstream moved none. The core and
plugin hashes match upstream/main, the channel hash is the branch's from
the last merge, and the combined hash is new. The generated channel
metadata is unchanged. The config docs, channel metadata, config schema,
plugin inventory, sqlite session schema and runtime sidecar checks pass
there.

Feishu: 102 files and 1265 tests in the extension project, and the 17
Feishu files in the database-workers project (213 tests), all passing.
The four monitor.lifecycle.test.ts failures seen at the last merge are
gone: openclaw#169616 moved lifecycle.test-support.ts to mock the async binding
route that bot.ts calls. The
src/channels/plugins tests (112 files, 809 tests) and the other tests that
use the forwarders pass. tsgo:core, tsgo:extensions, tsgo:test, the eight
baseline ratchets against upstream/main, the import cycle checks and oxfmt
on the changed files pass. Lint reports 15 max-lines errors, deadcode:full
reports 3 unused exports and db:worker-inventory:check reports a stale
inventory, all in files this branch leaves identical to upstream, and all
three reproduce on a clean 3f337ed.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
The ClawRouter pool dashboard (openclaw#169514) exported ClawRouterPoolTraffic, but
nothing imports it: control-ui.tsx derives the same shape through
ClawRouterPool["usage"]["lanes"][number]. The Knip production and full-tree
unused-export scans therefore fail for every change on main, which breaks the
dead export scan in scripts/check-changed.mjs. The type stays file-local
because pool.ts still uses it for the usage field and the traffic() parser.

The previously reported agentRunHasVisibleReply finding was already removed
by openclaw#169616; this was the remaining entry.

Proof: node --import tsx scripts/check-deadcode-exports.mts passes all three
scans with 0 entries (main at e79ac50 failed with only this symbol);
pnpm tsgo:core and pnpm tsgo:extensions clean; oxlint clean;
pnpm test extensions/clawrouter/pool.test.ts --maxWorkers=1 passes (5.3s).
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: feishu Channel integration: feishu channel: matrix Channel integration: matrix extensions: codex extensions: memory-core Extension: memory-core P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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