Skip to content

refactor: bring five owners under the line cap - #167979

Merged
steipete merged 4 commits into
mainfrom
refactor/line-cap-five-owners
Oct 10, 2026
Merged

steipete merged 4 commits into
mainfrom
refactor/line-cap-five-owners

Conversation

@steipete

@steipete steipete commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Five frequently edited core owners exceed the existing 700-line lint cap.

User Impact

No user-visible behavior change, configuration change, or migration is intended.

Why This Change Was Made

Remove duplicated HTTP authorization state, callback type contracts, completion branching, and unused cold-storage metadata. The existing poll-echo owner now keeps route/text matching and its cross-run expiry state together; the message executor consumes its decisions. Authorization checks, asynchronous restore completion, archival bounds, and message routing remain intact.

The diff is +129/−188 production lines (net −59), with 0/0 tests and 0/0 docs. No changelog changes.

Owner Physical lines Oxlint counted lines Numstat
Gateway HTTP 757 → 746 702 → 691 +14/−25
Message execution 741 → 694 701 → 661 +15/−62
Poll echo 95 → 145 83 → 126 +50/−0
Registry restore 752 → 735 713 → 696 +40/−57
Full catalog 741 → 721 709 → 689 +7/−27
Cold storage 719 → 705 702 → 689 +3/−17

HTTP and registry restore remain above the preferred 690 target; further identified cuts risk changing behavior or only compress formatting.

Evidence

Coordinator follow-up: cold restart preview is inherited

Merged pinned current main bc8f693df3aee184c65626f7e9c9c58889c51a8b without conflicts and pushed e704f03d7351ac3e0fe035c0721547005dc81a52, without force. All six authored source files remain byte-identical to the previously reviewed head. The cold-storage change remains intact at 689 lint-counted lines; no fix or revert was needed.

The identical cold archival → backup → exact transcript restoration → Gateway restart → preview scenario ran sequentially on one AWS r7a.xlarge lease, cbx_091f330845b1 (30.65 GiB, public networking, no IAM role/Tailscale/hydration). Both revisions passed seed, initial Gateway startup, 30/7-day archival, policy reload, missing-file refusal, portable backup, exact history restoration, initial shutdown, and restart startup. In the restart phase, both restored every original transcript row and emptied the cold-archive table, then failed the same assertion:

AssertionError [ERR_ASSERTION]: Activity must refresh omitted previews after restoration
actual: undefined
expected: 'I will remember it.'

The two complete restart failure logs are byte-identical, SHA-256 22775ca795b985debc7f35a91731e25153a488c54cfc31b2373ce72c75fcd224. This directly reproduces the reported failure without the PR changes; it is not PR-caused. The inherited preview failure remains unfixed, and the subsequent recovered-copy phase remains unrun on both.

Revision Real Gateway result Live wall time Focused owner/importer tests
Main bc8f693df3ae Same restart preview failure, exit 1 124.091s 39 files / 502 cases passed; one opt-in benchmark skipped; exit 0; 962.070s
PR e704f03d7351 Same restart preview failure, exit 1 123.884s 39 files / 502 cases passed; same benchmark skipped; exit 0; 728.754s

The same 40 unique test files were selected on each revision: all 11 src/config/sessions/session-cold-storage*.test.ts files, all direct touched-owner importers, and three family-only importers. There were no missing, extra, duplicated, failed, or unclassified unit cases. Both builds passed (main 341.976s; PR 332.760s). On the merged PR, pnpm tsgo:core passed in 66.602s and all 27 covering tsgo:core:test graphs passed in 1812.323s. CI run 38021251466 also completed successfully at the exact merged head e704f03d7351ac3e0fe035c0721547005dc81a52.

The shared client, fixture, lifecycle helper, payload reader, and maintained scenario files were byte-identical at the old head, pinned main, and merged PR. Client SHA-256: 87852260d49fb22c5bf23ca3bb7948dc653f6cb8bc10368aee34d618df24c1e1; fixture SHA-256: bdc29d9d930cea9e0ef75926deef8b8731657d23c6ce08523c50dbe28b56bc22. Normal random synthetic IDs/nonces, timestamps, ports, and isolated paths differed per cell; assertions, phase sequence, policy, timeouts, compiled CLI adapter, and toolchain were identical. Every Gateway was stopped and joined before the next cell.

The initial live attempts stopped earlier because the outer harness directory inherited group-write permission; backup correctly rejected that staging ancestor. Only the task-owned directory setup was corrected (0700), followed by one fresh live-only pair using the same builds and unchanged assertions. Unit tests and builds were not rerun for that correction. Source verification allowed only the two Workboard asset-pointer strings, with generated asset hashes verified against the build owner.

Unit/build/type run: run_ac3bc9c22f76584e809a61bc115b0217 (its aggregate exit 1 reflects the initial harness failures). Corrected live pair: run_fc8f7432c43572fa88bb9f7943bd0f86 (exit 1 reflects the identical inherited preview assertion). The sole comparison lease is stopped and absent from the verified listing. The unrelated 257 broad-suite failures below remain documented and were not investigated further.

Follow-up commands and exact test selection

Each revision used its own checkout/build on the same lease. pnpm build ran once per revision. The shared driver called the unchanged cold client phases through the compiled production CLI, with isolated state, ephemeral ports, a private home, and umask 077:

bash run-one.sh main "$main_checkout" bc8f693df3aee184c65626f7e9c9c58889c51a8b "$private_results"
bash run-one.sh pr "$pr_checkout" e704f03d7351ac3e0fe035c0721547005dc81a52 "$private_results"

The same native test command ran from each pinned checkout. Ordinary joined failures would continue through native routing; signals and watchdog failures would still stop.

tests=(
  packages/memory-host-sdk/src/host/session-memory-sync.test.ts
  src/agents/cli-runner/cli-run-transcript.admission.test.ts
  src/agents/embedded-agent-runner/context-engine-maintenance.preparation.test.ts
  src/agents/embedded-agent-runner/context-engine-maintenance.test.ts
  src/commands/doctor-maintenance.session-workers.test.ts
  src/commands/reset.sessions.test.ts
  src/config/sessions/legacy-main-session-migration.handoff.test.ts
  src/config/sessions/session-accessor.sqlite-branches.test.ts
  src/config/sessions/session-accessor.sqlite-cold-read.test.ts
  src/config/sessions/session-accessor.sqlite-import.test.ts
  src/config/sessions/session-cold-storage-eligibility.test.ts
  src/config/sessions/session-cold-storage-read.test.ts
  src/config/sessions/session-cold-storage.admission.test.ts
  src/config/sessions/session-cold-storage.inventory.test.ts
  src/config/sessions/session-cold-storage.lifecycle.test.ts
  src/config/sessions/session-cold-storage.preflight.test.ts
  src/config/sessions/session-cold-storage.publication.test.ts
  src/config/sessions/session-cold-storage.selection.test.ts
  src/config/sessions/session-cold-storage.sync-write.test.ts
  src/config/sessions/session-cold-storage.test.ts
  src/config/sessions/session-cold-storage.transcript-turn.test.ts
  src/config/sessions/session-history-eviction.writer-fairness.test.ts
  src/config/sessions/session-transcript-search.test.ts
  src/gateway/server-methods/chat-history-handler.test.ts
  src/gateway/server-methods/sessions-rewind.storage.test.ts
  src/gateway/server-methods/sessions-search-scope.test.ts
  src/gateway/session-activity-summaries.test.ts
  src/gateway/session-cold-storage-maintenance.test.ts
  src/gateway/session-history-cold.benchmark.test.ts
  src/gateway/session-history-lookup.worker.test.ts
  src/gateway/session-history-worker-lifecycle.test.ts
  src/gateway/session-history-worker-runtime.test.ts
  src/gateway/session-history-worker.integration.test.ts
  src/gateway/session-row-projection.incognito-actor.test.ts
  src/gateway/session-transcript-preview.hydration.test.ts
  src/gateway/session-transcript-title-reader.test.ts
  src/infra/session-cost-usage.archive-identity.test.ts
  src/plugin-sdk/session-transcript-runtime.guarded.test.ts
  src/sessions/user-turn-transcript.persistence.test.ts
  src/snapshot/session-cold-storage-backup.test.ts
 )
OPENCLAW_NODE_TEST_PLAN_CONTINUE_ON_FAILURE=1 pnpm test "${tests[@]}"
pnpm tsgo:core

The PR's covering type command used pnpm tsgo:core:test --changed-paths-json with src/config/sessions/session-cold-storage.ts plus the same 40 test paths. Selection digest: d921f4f2d3b599096373c2f65c34be49c06b71afbf345ce65c9c7482fedd4bc3.

Original campaign proof (historical head)

Original proof head: c76a6e708021324f524b32648f79b7e6873491f0. Main was merged before final proof; reviewed merge base: 05464f1c2e3dff0bc8d07b05630849e7bd137b2a.

The broad validation is not fully green. All 20 selected native configs settled: 18 passed and two failed. Across the full src/gateway, src/agents, and src/config/sessions selection plus 23 external direct importers, 4,382 files passed, 24 failed, and 25 skipped. There were 57,277 passing cases, 257 failures, 107 skips, three cases unclassified by the native summary, and nine Mac unhandled errors. No assertions, bounds, watchdogs, or worker limits were weakened.

Selection Files passed / failed / skipped Tests passed / failed / skipped Wall time
First four Mac configs 480 / 0 / 1 5,292 / 0 / 2 Included in 14,456s outer run
Mac Gateway 1,992 / 23 / 13 25,276 / 255 / 40 13,802.36s Vitest
AWS infrastructure 416 / 1 / 2 6,176 / 2 / 12 7,849.932s
AWS config/importers, plans 7–10 307 / 0 / 1 3,268 / 0 / 1 1,781.827s
AWS agent/embedded, plans 11–15 659 / 0 / 2 8,763 / 0 / 21 1,132.106s
AWS support/tools, plans 16–20 528 / 0 / 6 8,502 / 0 / 31 3,068.537s

The support config exited 0 with all 395 expected files, but its native test total exceeds its named pass/skip counts by three. Those cases are not counted as passed. No baseline runtime replay was performed for the broad failures, and they are not all labeled inherited.

  • The 700-line negative control reports all five original failures on the base and zero on the candidate. No implementation-mirroring regression tests were added.
  • pnpm tsgo:core, all 27 covering tsgo:core:test graphs, and all four pnpm tsgo:test:root graphs passed. Core and covering test graphs also passed on Linux.
  • Typed oxlint checked six files against 264 rules with zero diagnostics, including max-lines. Oxfmt and git diff --check passed. Private-QA pnpm build passed on fresh Blacksmith Testbox and AWS machines.
  • Independent Codex branch autoreview: scoped-clean through P2, no findings. ClawSweeper reviewed the same head with no findings. CI run 38008337910 completed successfully at the exact candidate SHA; this does not replace the broader results above.
  • Real isolated Gateway proof passed HTTP health 200, missing-token rejection 401, unsupported Expect rejection 417, full catalog listing, automatic 30/7-day cold archival, policy reload, missing-file refusal, portable backup, and exact transcript restoration.
  • The cold restart restored all transcript rows and removed cold archive rows, then failed the existing immediate lastMessagePreview assertion. Preview enrichment is asynchronous; source inspection also found a possible pre-existing empty-preview invalidation gap. The later recovered-copy phase did not run. The paired follow-up above now establishes that this preview assertion failure is inherited. The broader smoke is still not claimed fully green.
  • Real-Gateway QA Lab passed both message-tool-stranded-final-reply and subagent-stale-child-links: two passed, zero failed/skipped, using the mock OpenAI provider. Nonempty poll-vote suppression has deterministic owner-test coverage only because the QA channel has no poll-vote action.
  • The explicit control-ui-session-entry.real-auth.e2e.test.ts importer passed one file/seven tests in 60.76s on AWS. The cold-storage owner unit suite passed all 23 tests.

Failure attribution

Most Mac Gateway failures hit an old-schema database through the agent fixture's hardcoded /tmp/sessions.json, bypassing TMPDIR isolation. The unknown-owned database was left untouched. Missing build artifacts and two Buffer-stringification assertions are established fixture problems. The final-Gateway model-acquisition close failure reaches unchanged worker shutdown recovery; two contextTokens failures occur in manifest seeding before the patch RPC. Spawn fallback, lifecycle, timeout, and some secondary assertions remain unresolved. Eight unhandled errors are schema refusals; the ninth is a fixture spy reading .ok from a null worker message.

The two AWS infrastructure failures occur after successful label writes. Their SQL observer recognizes only UPDATE "session_nodes" SET; the canonical writer uses INSERT … ON CONFLICT. Earlier commit 6a8b0dceaf858e1ffd5d4c662aa88a095a564519 removed the separate validity UPDATE that had satisfied the predicate. The writer, observer, dispatch, and failing test are unchanged between the reviewed base and candidate. This is source/history attribution to a stale observer, not a reproduced baseline failure.

Live runs and cleanup

Proof used isolated state, synthetic credentials, and free ports. Candidate bytes were verified before execution. The generated Workboard manifest's two asset-hash fields were checked against their owner and exact asset bytes, then restored; they are excluded from this PR. Testbox reuse stalled during local source preparation, so remaining live proof used the authorized fresh AWS fallback. The installed Crabbox CLI handled later commands when an externally changed shared local dependency prevented the repository wrapper from starting; that shared install was not modified.

Lease Evidence
tbx_01m4h9zdctxqr1nzvwc6bw2b1a Fresh Testbox build/types/live preparation
cbx_090ab9849a2c QA passed, auth E2E passed, cold smoke with preview failure
cbx_6f570482a2b9 Infrastructure aggregate
cbx_58f1f076ca31 Config/importer configs
cbx_a1b0d1f4bbb6 Agent/embedded configs
cbx_4cb936f75b9b Support/tool configs

All six task-owned leases are released. The Mac runner retained two unreleased resource claims and its worker cache after failed fixture teardown. No supported postmortem release operation exists; that recovery state is preserved. The PR is ready for review, remains unmerged, and has auto-merge disabled.

Proof commands

Commands

All ordinary commands use TMPDIR=/private/tmp/oc-r7-capfive. The initial selection was:

pnpm test src/gateway src/agents src/config/sessions \
 src/channels/plugins/contracts/mattermost-read-authority.contract.test.ts \
 src/commands/doctor-maintenance.session-workers.test.ts \
 src/commands/models/list.prepared-catalog.test.ts \
 src/commands/reset.sessions.test.ts \
 src/cron/isolated-agent/run.message-tool-policy.test.ts \
 src/infra/heartbeat-runner.legacy-exec-binding.test.ts \
 src/infra/outbound/message-action-runner.broadcast.test.ts \
 src/infra/session-cost-usage.archive-identity.test.ts \
 src/plugin-sdk/session-transcript-runtime.guarded.test.ts \
 src/plugins/provider-model-routes.installed.test.ts \
 src/sessions/user-turn-transcript.persistence.test.ts \
 src/snapshot/session-cold-storage-backup.test.ts \
 test/channel-message-read-authority.integration.test.ts \
 test/discord-metadata-read-authority.integration.test.ts \
 test/feishu-message-mutations.integration.test.ts \
 test/feishu-message-read-authority.integration.test.ts \
 test/msteams-read-authority.integration.test.ts \
 test/msteams-read-target.integration.test.ts \
 test/openai-model-discovery-auth-order.test.ts \
 test/qa-channel-message-tool-delivery.test.ts \
 test/slack-download-read-authority.integration.test.ts \
 test/telegram-history-read.integration.test.ts \
 test/twitch-message-tool-delivery.test.ts

After the failed Gateway config, the untouched native configs continue with node scripts/run-vitest.mjs run --config <original config> and their exact original OPENCLAW_VITEST_INCLUDE_FILE inventories. No test filters, watchdogs, or worker limits were weakened. The original runner briefly entered its next config while its cleanup wrapper failed on an externally changed local dependency; that partial duplicate is excluded from counts. Its lease was then stopped through the installed CLI. The completed config-group receipt owns plans7–10.

pnpm tsgo:core
pnpm tsgo:core:test --changed-paths-json '["src/gateway/server-http.ts","src/agents/prepared-model-runtime.full-catalog.ts","src/agents/tools/message-tool-execution.ts","src/agents/tools/poll-vote-echo.ts","src/agents/subagents/registry/subagent-registry-restore.ts","src/config/sessions/session-cold-storage.ts"]'
pnpm tsgo:test:root
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json --format=json src/gateway/server-http.ts src/agents/tools/message-tool-execution.ts src/agents/tools/poll-vote-echo.ts src/agents/subagents/registry/subagent-registry-restore.ts src/agents/prepared-model-runtime.full-catalog.ts src/config/sessions/session-cold-storage.ts
OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build
OPENCLAW_BUILD_PRIVATE_QA=1 pnpm test src/gateway/control-ui-session-entry.real-auth.e2e.test.ts
pnpm dev qa suite --provider-mode mock-openai --concurrency 1 --scenario message-tool-stranded-final-reply --scenario subagent-stale-child-links --output-dir .artifacts/qa-e2e/capfive-independent

The isolated cold-storage driver uses scripts/lib/openclaw-e2e-instance.sh and scripts/e2e/lib/session-cold-storage/client.mjs against the compiled candidate, with a private state directory and ephemeral ports. The existing restart preview assertion failed; the subsequent recovered-copy phase did not run.

@clawsweeper

clawsweeper Bot commented Oct 9, 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 gateway Gateway runtime agents Agent runtime and tooling size: M labels Oct 9, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 9, 2026
@clawsweeper

clawsweeper Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR consolidates internal contracts, authorization bookkeeping, poll-echo state, and redundant branches to bring five core owners below the existing line cap.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused refactor is coherent and supported by production-path evidence and green exact-head CI; the broader campaign is explicitly not claimed fully green.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (logs): Supplied isolated Gateway evidence exercises HTTP rejection, catalog listing, message completion, subagent recovery, and cold archival/restoration; the exact-head paired cold run reproduces the same preview failure on base and head, while nonempty poll suppression remains covered by existing tool tests.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No user-visible defect is claimed; frequently edited core modules exceed the repository's existing line cap.
Reason: The bounded change removes duplication and keeps decisions with existing owners without introducing settings, defaults, or a new public contract.

Merge readiness

✅ Ready for maintainer review

This PR is a useful, behavior-preserving consolidation with no identified correctness or security findings; it merits normal landing consideration.

Priority: P3
Reviewed head: e704f03d7351ac3e0fe035c0721547005dc81a52

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway HTTP requests, agent message actions, model catalog preparation, and persisted-session recovery enter existing core owners, which authorize, dispatch, publish catalogs, and restore or archive session data.

flowchart TD
  A[Clients and agent runs] --> B[Gateway HTTP routing]
  A --> C[Message execution]
  C --> D[Poll echo owner]
  A --> E[Prepared model catalog]
  B --> F[Existing authorization and dispatch]
  A --> G[Registry and cold storage recovery]
Loading

Technical review

Best possible solution:

Land the focused consolidation through the normal maintainer workflow while tracking unrelated existing failures separately.

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

This is a refactor rather than a reported product bug; source comparison supports the stated consolidation, and this review ran no target code.

Is this the best way to solve the issue?

The change appropriately reuses existing owners and canonical types while preserving the affected control flow and public behavior.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Message execution and poll echo keeps the original intent (refactor(agents): split message-tool into concept modules #121901: Separate message-tool concepts while retaining dispatch and poll-echo behavior; the later inclusive-expiry repair is documented in fix(agents): expire poll vote echo at TTL #133996.)
  • Registry restoration keeps the original intent (3f761a8: Keep overlapping registry writes ordered and preserve cleanup and requester-wake ownership.)
  • Prepared catalog contracts and publication keeps the original intent (0a549d2: Separate snapshot construction from catalog preparation without changing resource ownership; later retention behavior remains intact.)
  • HTTP authorization staging keeps the original intent (081810c: Keep one ordered stage array with authorization before plugin dispatch and unchanged short-circuit behavior.)
  • Cold transcript maintenance keeps the original intent (7dd2721: Propagate cancellation through existing queue owners while preserving accepted writes and cleanup settlement.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source -59. Total -59 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 129 188 -59
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 129 188 -59

Review metrics

Metric Value Why it matters
Production versus tests Production +129/-188; tests +0/-0 The net reduction consolidates existing responsibilities without adding test maintenance or new configuration surface.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal maintenance with no intended change to user-visible behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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 need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-10T00:23:13.660Z sha c76a6e7 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-10T02:04:43.596Z sha c76a6e7 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-10T02:55:57.287Z sha c76a6e7 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-10T03:23:18.173Z sha c76a6e7 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-10T03:53:07.281Z sha e704f03 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-10T04:16:07.709Z sha e704f03 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-10T05:01:41.923Z sha e704f03 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-10T05:55:47.262Z sha e704f03 :: needs maintainer review before merge. :: none

Reviewed October 10, 2026, 2:02 AM ET / 06:02 UTC (Revision 11).

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Oct 10, 2026
@steipete
steipete marked this pull request as ready for review October 10, 2026 00:16
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: e704f03d7351ac3e0fe035c0721547005dc81a52
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/server-http.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 10, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 10, 2026
@steipete
steipete merged commit 988c6ee into main Oct 10, 2026
166 checks passed
@steipete
steipete deleted the refactor/line-cap-five-owners branch October 10, 2026 06:40
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 10, 2026
#167979 moved the matcher's only production caller into suppressPollVoteEcho,
leaving isPollVoteEchoText exported solely for its unit test. The Knip
production unused-export scan rejects that export, so pnpm check:changed fails
on main for local and Testbox runs (GitHub Actions only reports it as advisory).

Make the matcher module-private and drive the unchanged matcher table through
the module's real public pair, recordPollVote -> suppressPollVoteEcho. No
production behavior change.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
* refactor: bring five owners under the line cap

* refactor: type restored session callback capture
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
openclaw#167979 moved the matcher's only production caller into suppressPollVoteEcho,
leaving isPollVoteEchoText exported solely for its unit test. The Knip
production unused-export scan rejects that export, so pnpm check:changed fails
on main for local and Testbox runs (GitHub Actions only reports it as advisory).

Make the matcher module-private and drive the unchanged matcher table through
the module's real public pair, recordPollVote -> suppressPollVoteEcho. No
production behavior change.
RomneyDa added a commit that referenced this pull request Oct 20, 2026
Retain the release branch model-catalog owner while applying the five compatible owner splits.

Co-authored-by: RomneyDa <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 20, 2026
* test(discord): classify native registry cases as test support

Keep the backported native routing cases out of production dependency and database-worker inventories while retaining their focused coverage.

Co-authored-by: RomneyDa <[email protected]>

* chore(agents): shrink settings assertion baseline

Co-authored-by: RomneyDa <[email protected]>

* fix(agents): keep the poll vote echo matcher private (#168333)

#167979 moved the matcher's only production caller into suppressPollVoteEcho,
leaving isPollVoteEchoText exported solely for its unit test. The Knip
production unused-export scan rejects that export, so pnpm check:changed fails
on main for local and Testbox runs (GitHub Actions only reports it as advisory).

Make the matcher module-private and drive the unchanged matcher table through
the module's real public pair, recordPollVote -> suppressPollVoteEcho. No
production behavior change.

Co-authored-by: RomneyDa <[email protected]>

* test(cron): await archive RPC after cancellation

The PR-automation archive fixture treated the cron finished event as a
session-patch response receipt. Archiving cancels the occurrence from the
committed cron update while the archive RPC is still finishing, so the
response assertion raced that handler.

Capture and join the actual archive request before inspecting its response.
Hold the real cron update after commit to reproduce this ordering without
timers, while preserving every existing session identity, cancellation,
disabled-job and teardown assertion. Keep worker run rows and launch checks
unchanged.

The forced pre-fix control reproduced the hourly's zero-response failure
(1 failed, 2 passed). The fixed file passed all 3 cases: 100.79s Vitest,
105.94s wrapper with --maxWorkers=1; most elapsed time was compilation/import.
Cron test types, type-aware lint, boundary lint and formatting passed.
P2 autoreview is scoped-clean. Full cron-config proof passed: 1,961 tests
in 251 files, 1090.77s, one worker.

Focused command: pnpm test src/cron/service.pr-automation.test.ts --maxWorkers=1
Full config: node scripts/run-vitest.mjs run --config
test/vitest/vitest.cron.config.ts --maxWorkers=1

Refs: main CI run 38881317413, job 116908788842.
Co-authored-by: RomneyDa <[email protected]>

* fix(update): settle state writers before Doctor schema repair (#177844)

* fix(update): consume SQLite migration source once

* fix(update): retain captured source through Doctor preparation

* fix(update): settle state writers before Doctor schema repair

Drain prior canonical handles before private schema repair so their native-close receipts publish legitimate maintenance writes and release exclusive custody. Keep all migration attribution and strict source checks; remove the source-consumption workaround that lost later Doctor writes.

Co-authored-by: RomneyDa <[email protected]>

* fix(release): close required-backport compatibility gaps

Restore test-only transcript access, classify the extracted update helper as test support, retain the full PR-wrapper runtime closure, align native-bootstrap journal expectations, and point non-isolated fixtures at the extracted state owner.

Co-authored-by: RomneyDa <[email protected]>

* fix(cli): preserve JSON output when gateway commands exit (#176795)

Co-authored-by: RomneyDa <[email protected]>

* test(cli): preserve exit semantics in gateway harness

Construct the mocked runtime exit with the production ExitError so JSON completion remains distinguishable from ordinary command failures.

Co-authored-by: RomneyDa <[email protected]>

* test(agents): distinguish hidden recovery prompts from user turns

prompts as hidden internal_system user rows to preserve model-prefix
bytes. The finalization and cron fallback tests still counted those rows
as new user turns.

Require the expected hidden rows and their provenance, retain the single
visible original turn, and verify finalization does not hide the next real
user message. Keep receipt, attempt-count, provider-request, fallback-notice
and final-answer assertions intact. No production behavior changes.

Proof: both hourly failures reproduced on current main; all eight focused
cases pass with --maxWorkers=1, including runtime retry/cold-reopen coverage.
Agents and cron test typechecks, typed lint, boundary lint, formatting and
P2 autoreview pass.

Co-authored-by: RomneyDa <[email protected]>

* test(memory): join background dreaming cleanup at stop

Align the startup-admission proof with #169945: the gateway hook no longer blocks on historical cleanup, while service stop remains the deterministic settlement boundary.

Co-authored-by: RomneyDa <[email protected]>

* fix(cli): use typed exits for gateway JSON commands

Backport the narrow runtime exit contract required by #176795 without importing the full #168587 refactor, and keep the gateway harness mock non-throwing outside the explicit typed-exit proof.

Co-authored-by: RomneyDa <[email protected]>

* fix(update): restore initialization selector revalidation

Restore the selector fence omitted by the partial #168882 compatibility backport while keeping the core file within the release line count ratchet.

Co-authored-by: RomneyDa <[email protected]>

* test(agents): align recovery prompts with release behavior

Match the current finalization prompt text while retaining the release-line provider fallback contract of one visible cron user turn.

Co-authored-by: RomneyDa <[email protected]>

* fix(update): finalization ignores TMPDIR for disposable copies

Keep update inspection images and source captures on the candidate helper temporary volume without relocating native admissions or recovery backups.

Co-authored-by: RomneyDa <[email protected]>

* fix: native app messages fail after reconnecting

Co-authored-by: RomneyDa <[email protected]>

* test: prove native reconnect dispatch and stale-session policy

Co-authored-by: RomneyDa <[email protected]>

* fix(codex): previews block replies after context refresh

Co-authored-by: RomneyDa <[email protected]>

* fix(codex): preserve persistent policy checks during context refresh

Co-authored-by: RomneyDa <[email protected]>

* test(codex): narrow active binding before checking successor

Co-authored-by: RomneyDa <[email protected]>

* fix(ui): offer desktop setup instead of Retry when Host Desktop is off

- The chat Desktop panel asks environments.list for desktopSetup only when
  its unresolved automatic target is the Gateway host.
- The panel says desktop access is not enabled on the Gateway host and that
  it shares the Gateway host's screen, shows setup steps worded for the
  Gateway host plus account and network notes, and offers Enable desktop
  access when the connection can patch config (else the administrator
  hint) or Check again, then re-reads inventory and connects the Gateway
  desktop.
- Systems and the panel share the setup state selection and the
  desktop.host.enabled patch helper; other targets, document mode and a
  failed setup check keep desktop.sourceUnavailable.
- The setup helper declares its own runtime-config shape and imports
  nothing from desktop-panel-inputs.ts, so the type import runs one way.
- Docs mention the chat panel path.

Co-authored-by: RomneyDa <[email protected]>

* test(ui): adapt Host Desktop setup proof to Lit

Use the release-line i18n registry, shadow-root assertions, and Lit settlement instead of the upstream Solid-only test helpers.

Co-authored-by: RomneyDa <[email protected]>

* fix(release): repair merged validation fixtures

Co-authored-by: RomneyDa <[email protected]>

* refactor(release): close candidate source ratchets

Co-authored-by: RomneyDa <[email protected]>

* test(update): restore safe managed handoff fixtures

Complete the #168722 fixture integration omitted by the release backport.

Co-authored-by: RomneyDa <[email protected]>

* test(release): drop incompatible question cleanup

The release snapshot does not retain the mainline sharing-read owner introduced after this branch point.

Co-authored-by: RomneyDa <[email protected]>

* test(codex): adapt recovery fixture to release helper

Co-authored-by: RomneyDa <[email protected]>

* refactor(cli): simplify update and offline repair bookkeeping

Use the rehearsed configuration during update activation instead of looping
through candidate checks after late config edits. Rely on the sequential node
auto-update caller and Doctor's exclusive maintenance ownership for internal
pause and title bookkeeping. Preserve validation, schema, authorization,
service-publication, privacy and work-settlement boundaries.

Best-effort tradeoffs accepted:
- Late root/include edits no longer restart rehearsal (b36eb3e's injected
  save cases); incompatible edits can require correction or Doctor/restart.
- Unsupported overlapping pause/resume calls do not retain distinct tokens
  (#149517); the production auto-update loop awaits each pause before resume.
- Concurrent foreground title changes during offline Doctor are unsupported
  (#151211); existing names/incognito sessions and live commit authority stay.

Remove 76 net production lines and 292 test lines. Focused proof covers 177
supported node/update/Doctor cases; core types, both zero-cycle checks, typed
lint, formatting and independent P2 review pass. The lint-suppression test has
an inherited allowlist mismatch already fixed on main in dab6a8d. Full
changed-check and release-matrix proof are not claimed for this branch-only
below-500 simplification.

Co-authored-by: RomneyDa <[email protected]>

* refactor(cli): simplify update and worker lifecycle guards

Carry admitted snapshots through updates and retain live authority at effects. Remove speculative observation, generation, and bookkeeping machinery while preserving rollback, native settlement, bounded resources, and public interfaces.

Co-authored-by: RomneyDa <[email protected]>

* test(cli): align Windows probes with single service inspection

Co-authored-by: RomneyDa <[email protected]>

* test(cli): retire remaining synthetic completion checks

Co-authored-by: RomneyDa <[email protected]>

* fix(cli): preserve shutdown and update fixture contracts

Co-authored-by: RomneyDa <[email protected]>

* fix(cli): preserve full config read failures

Co-authored-by: RomneyDa <[email protected]>

* test: retire obsolete command revalidation scenarios

Co-authored-by: RomneyDa <[email protected]>

* test: revoke publication authority after confirmed service stop

Co-authored-by: RomneyDa <[email protected]>

* test(cli): align progress fixtures with simplified ownership

Co-authored-by: RomneyDa <[email protected]>

* fix(plugins): retain Windows dependency links across Doctor phases

Co-authored-by: RomneyDa <[email protected]>

* fix(update): guide Windows task disable permission failures

Refs #170956 (finding 3). Preserve the autostart disable guard while reporting definite access denials with elevation and manual-update guidance, without attempting an unnecessary enable.

Co-authored-by: RomneyDa <[email protected]>

* fix(doctor): suggest retry after snapshot contention

Co-authored-by: RomneyDa <[email protected]>

* fix: Windows backup scratch cleanup fails with EPERM

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: RomneyDa <[email protected]>

* fix(update): recognize Dutch Scheduled Task access denial

Co-authored-by: RomneyDa <[email protected]>

* fix(release): retain native lifecycle dependencies

Adapt required PR #168882 to the 2026.10.6 architecture without importing unrelated mainline dependency trees.

Co-authored-by: RomneyDa <[email protected]>

* fix(release): preserve initialization revalidation

Retain the later release-specific selector fence while adapting required PR #168882.

Co-authored-by: RomneyDa <[email protected]>

* test(release): adapt Doctor contention fixture

Exercise the required #176779 guidance through the 2026.10.6 database admission interface.

Co-authored-by: RomneyDa <[email protected]>

* test(release): shrink mock export baseline

Remove the obsolete plugin lifecycle config mock exception eliminated by required PR #168882.

Co-authored-by: RomneyDa <[email protected]>

* fix(release): adapt lifecycle refactor interfaces

Preserve required PR #168882 while retaining the 2026.10.6 progress, child-binding, and Doctor convergence contracts.

Co-authored-by: RomneyDa <[email protected]>

* test(release): adapt simplified update lifecycle

Keep the required #168882 validation coverage while retaining the 2026.10.6 sidecar catalog and update-run fixture contracts.

Co-authored-by: RomneyDa <[email protected]>

* test(release): drop unsupported settle-window fixture

Remove the #178170 test-only import that depends on #172069 settlement timing, which is not part of the 2026.10.6 release architecture.

Co-authored-by: RomneyDa <[email protected]>

* fix(release): close expanded candidate lint

Remove stale and redundant constructs while restoring the two pre-existing max-lines suppressions accidentally dropped by the earlier repair commit.

Co-authored-by: RomneyDa <[email protected]>

* refactor(release): split oversized candidate files

Split the BTW runtime helpers and Doctor memory-auth scenarios so the required backports satisfy the source-size ratchet without adding suppressions. Consolidate the duplicated Docker activation marker spelling to close inherited environment-inventory drift.

Co-authored-by: RomneyDa <[email protected]>

* test(release): document split isolation boundaries

Document the intentionally closed Doctor mocks and runtime transcript assertions introduced by the validation-safe file split, and prune the repaired assertion baseline entry.

Co-authored-by: RomneyDa <[email protected]>

* style(release): format validation runner changes

Apply the repository formatter to the backported test runner and workflow guard updates.

Co-authored-by: RomneyDa <[email protected]>

* fix(cli): preserve typed exits after output drain

Catch the default runtime's typed ExitError inside the legacy output-drain callback and retain its process status. This keeps the V8-safe typed exit contract while preventing successful help renders from surfacing as uncaught failures.

Co-authored-by: RomneyDa <[email protected]>

* perf(ui): defer page-only English copy from startup

Adapt upstream PR #178054 to the release branch after the TypeScript page migration.

Co-authored-by: RomneyDa <[email protected]>

* chore(ui): refresh Host Desktop locales

Adapt upstream locale refresh PR #178236 to the 20-locale release catalog.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Co-authored-by: RomneyDa <[email protected]>

* fix(ui): register lazy secret copy at view boundary

Keep direct page rendering self-contained and retain the current plugin catalog anchor type.

Co-authored-by: RomneyDa <[email protected]>

* docs(changelog): refresh 2026.10.6 contribution record

Co-authored-by: RomneyDa <[email protected]>

* fix(windows): recognize task permission denials in every locale (#178624)

(cherry picked from commit 00cb4b3)

Co-authored-by: RomneyDa <[email protected]>

* docs(changelog): record Windows locale recovery backport

Co-authored-by: RomneyDa <[email protected]>

* fix(apple): Shared OpenClawKit Periphery fails on every OpenClawKit PR (#168171)

The reconnect-backoff hooks added in #168024 lived in OpenClawKit
Sources but were called only from OpenClawKitTests. The shared
Periphery workflow scans the iOS and macOS consumer indexes, and
neither builds OpenClawKitTests, so both reported
_test_setReconnectBackoffMs(_:) and _test_reconnectBackoffMs() as
unused and the intersection failed on every PR touching the kit.

Move the setter into the test file's existing @testable fileprivate
GatewayChannelActor extension, beside seedPathRecoveryConnectBackoff,
and read the internal backoffMs directly. The remaining _test_ hooks
stay because the macOS OpenClawIPCTests call them.

Proof: swift test --filter GatewayNetworkPath (10 tests in 2 suites,
including the reset-both-backoffs case) passes; SwiftFormat clean.

(cherry picked from commit 46d5488)

* chore(ui): move Host Desktop locale refresh out of source PR

This reverts commit f777409.
CI preflight requires generated Control UI locale artifacts to land
isolated from source changes; the refresh lands on the release branch
as its own generated-only commit after this PR merges.

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Jacqueline Henriksen <[email protected]>
Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: n572770 <[email protected]>
Co-authored-by: xuzhijun <[email protected]>
Co-authored-by: openclaw-mantis[bot] <281431406+openclaw-mantis[bot]@users.noreply.github.com>
amittell added a commit to amittell/openclaw that referenced this pull request Oct 28, 2026
…flicts

- agent-tools.ts: the fork's assembleTurnToolSurface (owner-only refusing
  stubs) combined with beta.4's unavailable-publication-tool handling; the
  exposed filter drops that tool from both the authorized and model-facing
  lists. The cron-creator binders follow beta.4 into
  prepareSessionPortalToolAccess. 699 counted lines.
- agent-tools.before-tool-call.wrapper.ts: one owner for
  recordPreExecutionBlockedToolCall, the fork's before-tool-call.state.ts
  (tool-terminal-outcome.test.ts imports it there); beta.4's local copy in the
  wrapper is removed, and beta.4's pruneTrackedToolCallIds stays.
- agent-tool-definition-adapter.ts: imports isOwnerOnlyToolStub next to
  beta.4's readNodePermissionError.
- scheduled-message-invocation.ts: beta.4's resolvePolicies plus the fork's
  ownerOnlyStep for filterTurn.
- message-tool-execution.ts: beta.4's poll-vote echo check and record move,
  with the fork's duplicate-send guard, behind one checkMessageToolSendGuards
  call in the fork's send-guards module (713 -> 695 counted lines, cap 700).
  The fork's two message_tool_only gates are dropped: pollEchoSessionKey is
  already undefined outside message_tool_only (since openclaw#167979), and
  suppressPollVoteEcho returns false for it.
- attempt-session-prepare.ts: beta.4's inline settings block (it now needs
  sessionId and returns compactionEnabled) plus the fork's checkpoint-handle
  formatter and trustedLocalMediaToolNames; 699 counted lines, so the fork's
  attempt-session-settings.ts split is deleted (no importers).
- subagent-session-reconciliation.ts: the fork's transcript-tail recovery
  reads through beta.4's resolveSubagentChildSessionOwner.
- embedded-agent-subscribe.types.ts, session-tool-result-guard-wrapper.ts,
  attempt-session-runtime-prepare.ts, tool-description-presets{,.test}.ts:
  both sides' additions.
- Tests updated by reading, to run on the M4: attempt-prompt-context (beta.4's
  temporal-context fragment added to the fork's v3/v4 carrier pins),
  agent-tools.construction-routing (beta.4's two non-owner tests filter
  refusing stubs), sessions-history-tool (openclaw#169063 removed payload masking, so
  the compaction-span test expects contentRedacted: false).
- Docs: slash-commands and session-tool combine both sides (no "redaction"
  after openclaw#169063); ask-user is byte-identical to beta.4, which has the fork's
  paragraph natively.

Not built here (no builds on this host); tsgo and tests run on the M4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed 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