Skip to content

refactor: fold private request handoffs into their owners - #178251

Merged
steipete merged 1 commit into
mainfrom
deslop/z25-55-private-request-owners-20261015
Oct 20, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/z25-55-private-request-owners-20261015

Conversation

@steipete

@steipete steipete commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Several private helpers have one production consumer and only transport facts that the consuming operation already owns. One internal picker module also exists solely to receive a large context packet from its slash-command caller.

User Impact

No intended user-visible change, migration or operator action. Public request, rendering, installation and credential behavior stays in its existing owners.

Why This Change Was Made

Fold those private handoffs into the existing request, installation, consent and credential-collection operations. Remove the Mattermost picker leaf after moving it into its actual branch. Keep the shared algorithms, public entry points, external validation, effect authorization, cancellation, response bounds and recovery owners.

Strict production delta against the rebased branch base: +1,993 / -2,518 = 525 net lines removed, across 16 paths. Tests are unchanged. No public SDK/package API, CLI/config/protocol, dependency, persisted format, schema or permission change. The standalone session-memory backend and its factory/registry/expiry/federation machinery and tests are untouched.

Best-effort tradeoffs accepted

  • Private helper signatures and incidental Promise-resolution hops are not public contracts or ordering primitives. Operation-level awaits, captured inputs, cancellation and awaited disposal remain at their existing boundaries.
  • The package-root traversal from #102883 now returns directly when no matching root exists. Its old post-helper undefined check is redundant because the only loop exit follows successful realpath; no missing-root or realpath-failure behavior is dropped. The native path, file/hash/manifest, size and admission checks stay.
  • No new fallback, compatibility path, cast, suppression, test seam or defensive protocol replaces the removed forwarding. No guarded security, durability or realistic-concurrency scenario is intentionally dropped.

Evidence

  • Complete affected production owners, consumers, relevant provenance and active feature overlaps inspected. Author simplification completed; capture timing and early-return boundaries checked.
  • Independent complete-packet P0-P2 review is scoped-clean with no accepted/actionable findings (0.96), using 17 complete unchanged public test files as context. That source context is not execution proof.
  • Initial targeted core/extension/AI graphs pass. Syntax lint caught binding-shadowing diagnostics from the folds, including one remaining Password-task branch on replay; the inner locals were alpha-renamed without changing property keys or outer references. The final syntax replay passes.
  • Before conflict integration, completed focused groups: daemon/install 263, providers 133, Mattermost 33, Diffs 25, AI 64, consent 35, Google cache 50, channel credentials 11, CLI identity 10 and prefix stability 5 cases pass (629 total; the unchanged CLI suite also retains nine platform skips).
  • One unchanged Mattermost capacity-boundary test fails locally at line 374 with zero callbacks instead of eight. The fixture binds clients to alternate loopback source addresses; a direct host probe returns EADDRNOTAVAIL for 127.0.0.2. One serial exact-base replay at 9970230915c8a058d22ee1156664f56bae1678d8, with all 16 changed production paths restored to base, reproduces the identical assertion in the same unchanged test. All exact candidate/index bytes were restored and verified afterward. This is an investigated host limitation, not a repaired test or a claim of passing local proof. Hosted exact-head CI remains the platform gate. No alias, skip, retry or timeout change was added.
  • Core/extension/AI typed lint, extension boundaries, line-cap/assertion/mock ratchets, suppression (14 cases), wrapper/import closure (4 selected cases), runtime import cycles (0) and Madge cycles (0) pass. Final scoped formatting and staged whitespace checks pass. The interrupted Madge attempt was not counted; its resumed run completed successfully.
  • Diffs real-renderer/real-SSR head-versus-base proof passes for four synthetic cases and six complete documents (890,962 bytes per revision). Every raw HTML byte and the manifest match without normalization; SSR is nonempty, exact head source was restored, and seven pinned dependency/config inputs stayed unchanged. No snapshot, HTML whitespace or generated-output baseline changed. Rendering scratch was removed after comparison; this does not claim rasterized pixels or browser/live serving.
  • Conflict-only integration onto main 96c031792485144cb9c80bfb69eba28a8a250453 preserves main refactor(ai): simplify bounded tool preparation and report broken descriptors #177997's Mistral empty-conversion-check removal. The old-to-new Mistral delta is only those eight main-deleted lines; the other 15 candidate paths and dependency/formatter inputs are unchanged. On rebased head fe82f68f57e881c5c5403035042842027a64785f, targeted AI native types, Mistral typed lint, all three public Mistral suites (43 cases), suppression (14 cases), runtime cycles (0), Madge cycles (0), formatting and whitespace checks pass. Prior unaffected-input proof is reused, not presented as rerun on this head.

Exact-head hosted CI run 39393823728 completed successfully for fe82f68f57e881c5c5403035042842027a64785f, including openclaw/ci-gate and security-fast. No CI rerun was requested. Earlier canceled context/evidence jobs were superseded by the successful same-head context/evidence job in run 39393823180; the draft-only skipped CI run is not proof. There are no failing exact-head CI jobs to attribute.

Local proof uses isolated HOME/OpenClaw/XDG paths, nice10, serial one-worker focused Vitest and targeted native type graphs. No broad local suite, whole-graph typecheck, build, E2E, live provider/device or operator-state proof is claimed. The investigated local loopback limitation remains recorded above, not relabeled a passing local test.

@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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR folds single-consumer request, rendering, installation, consent, and credential helpers into their existing owners.

Example: A Mattermost user invokes /models.

  • Before: The slash handler passes its context to a separate picker module, which sends and records the reply.
  • After: The slash handler sends and records the same reply directly through the existing delivery and transcript owners.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Source inspection supports the refactor and its retained contracts; supplied validation is focused and harness-based, with broad product CI not yet demonstrated.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored internal refactor is outside the ordinary contributor proof gate; the supplied evidence reports focused suites and real-renderer HTML equivalence, with no shipped-entry-point or live-service claim.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The maintainer-authored direction removes unnecessary private handoffs while keeping responsibilities, effects, and public behavior with their existing owners.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored PR open: the refactor removes private forwarding without a concrete introduced regression, but GitHub reports a merge conflict and the PR remains draft.

Priority: P3
Reviewed head: f1fb9a1800dc06298cd4c10d2d45faf02092cd90

Before merge

  • Complete next step - Resolve GitHub’s reported merge conflict while retaining current Mistral tool preparation, then mark this PR ready when its author considers it complete.

Findings

None.

Agent review details

How this fits together

Provider requests, slash commands, service installation inputs, plugin artifacts, and channel credentials enter existing operations that produce network requests, replies, service definitions, consent records, or resolved credentials.

flowchart TD
  A[Request or installation inputs] --> B[Existing operation owner]
  B --> C[Shared validation and authorization]
  C --> D[Provider or platform adapter]
  D --> E[Network or filesystem effect]
  E --> F[Existing recording and recovery]
Loading

Technical review

Best possible solution:

Retain the consolidation while resolving the reported conflict with current Mistral behavior preserved.

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

This is a behavior-preserving refactor rather than a bug report; inspection found no definite introduced failing input, and no target code was executed during review.

Is this the best way to solve the issue?

The consolidation uses existing operation owners, removes the replaced private paths, and preserves shared algorithms and public contracts without introducing replacement machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Mattermost slash handling and picker transcript recording keeps the original intent (9630174: Retain delivered native picker replies and button labels in conversation history, after successful delivery.)
  • Google prompt-cache lifecycle keeps the original intent (715760d: Optional cache failures must preserve uncached generation while cancellation, writer authority loss, and primary failures remain fatal.)
  • CLI executable identity keeps the original intent (96f0983: Bind verified setup to the actual executable and runtime artifact rather than an unverified launcher.)
  • Daemon environment planning keeps the original intent (22fa9f5: Preserve eligible provider credentials across Linux service installation without changing operator ownership.)
  • Windows and systemd activation keeps the original intent (cb099f5: Separate service implementation responsibilities while preserving launcher serialization, recovery, and platform behavior.)
  • Plugin artifact consent keeps the original intent (0dbd5c8: Bind capability acceptance to the reviewed artifact and recheck its declared surface after interactive work.)
  • Channel credential ownership keeps the original intent (4ecd85e: Isolate failed channel credentials without disabling unrelated healthy accounts.)
  • OpenRouter OAuth keeps the original intent (b9280d5: Keep PKCE authentication owned by the provider; later callback cleanup and live-authority checks remain present.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 3ed3248 adds src/commands/daemon-install-helpers.ts:50 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3ed3248d7bf5; files: src/commands/daemon-install-helpers.ts)

PR surface

Source -525. Total -525 across 16 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 16 1961 2486 -525
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 16 1961 2486 -525

Review metrics

Metric Value Why it matters
Production versus tests Production +1,961/-2,486; tests unchanged The net reduction comes from removing private signatures and forwarding packets while retaining the existing behavioral suites.

Labels

Label changes:

  • add P3: This is internal cleanup with no intended user-visible behavior change or established urgent defect.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is internal cleanup with no intended user-visible behavior change or established urgent defect.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • 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, 4:23 AM ET / 08:23 UTC.

@steipete
steipete force-pushed the deslop/z25-55-private-request-owners-20261015 branch from f1fb9a1 to fe82f68 Compare October 20, 2026 08:29
@steipete
steipete marked this pull request as ready for review October 20, 2026 08:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T08:32:49.811254Z fe82f68 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

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: fe82f68f57e881c5c5403035042842027a64785f
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/secrets/channel-secret-basic-runtime.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@steipete
steipete merged commit 986a3fc into main Oct 20, 2026
214 of 217 checks passed
@steipete
steipete deleted the deslop/z25-55-private-request-owners-20261015 branch October 20, 2026 08:53
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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: mattermost Channel integration: mattermost commands Command implementations extensions: chutes extensions: diffs extensions: microsoft-foundry extensions: openrouter gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: XL 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