Repository navigation
refactor(cli): simplify Gateway fallback and hook state ownership - #129802
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 11:48 PM ET / August 26, 2026, 03:48 UTC. ClawSweeper reviewWhat this changesThe PR consolidates CLI Gateway fallback classification, Skills RPC envelopes, and Hooks enable/disable config writes while preserving existing command behavior. Merge readinessKeep open for maintainer handling: this is a meaningful, compatibility-sensitive cleanup of the recently merged Gateway-authority repair. Source review found no actionable correctness defect, but exact-head CI and maintainer acceptance remain required. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherSkills and Hooks CLI commands first ask the selected Gateway for state; only an implicit local Gateway may fall back to local discovery or mutation under narrow transport or legacy-method conditions. Hook toggles then persist the selected hook state to configuration. flowchart LR
CLI[Skills or Hooks CLI] --> RPC[Gateway request]
RPC --> Classify[Fallback classification]
Classify --> Gateway[Selected Gateway result]
Classify --> Local[Implicit local recovery]
Local --> Skills[Local Skills state]
Local --> Hooks[Hook config update]
Decision needed
Why: The PR changes a shipped compatibility and ownership boundary, and its protected maintainer label requires explicit human handling despite no source-level defect found. Before merge
Agent review detailsSecurityNone. PR surfaceSource -59, Other 0. Total -59 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain one canonical fallback classifier with the existing exact legacy and implicit-local conditions, then land only after exact-head owner-boundary checks pass. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR claims behavior preservation, and the review compares its shared implementation against the existing fallback and lock-owner boundary. Is this the best way to solve the issue? Yes: consolidating duplicate fallback and Hook-write paths is the best maintainable shape because the exact boundary remains explicit and is reused by all affected CLI flows. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 345cfde43dc9. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
8da05bd to
64dc17a
Compare
|
Merged via squash.
|
* origin/main: (24 commits) fix(gateway): reject rootless session permission modes (#128149) docs(memory): document shipped turn-taint propagation for network tool output (#129837) fix(ui): pool reply-less wake activity into one chat rollup (#128442) fix(package): prevent installs from deleting validated runtime assets (#129724) fix(nodes): approve silent initial node surfaces and name the pending surface approval (#129795) fix(backup): preserve configured agent state roots (#129773) fix(ui): own chat history issuance with a closed state machine (#129776) fix(cron): preserve cancellation reason after late finalization (#129331) fix(cron): prevent run waits from failing after clock changes (#129805) fix(telegram): route commentary through one frozen progress owner (#128259) fix(release): start approved VCR mirror recovery jobs (#129829) test: complete current-plugin-metadata-snapshot mock factories (#129791) test(telegram): remove duplicate reaction case (#129848) fix(channels): honor supported account reply-threading policies (#129679) refactor(cli): deduplicate lazy subcommand registration (#129351) fix(ai): report interrupted local-model streams instead of empty success (#129794) refactor(cli): consolidate Gateway fallback and hook ownership (#129802) fix(qa): reject token confidence lanes without executed evidence (#129830) fix(tui): fence session state and delayed actions (#129810) fix(control-ui): keep task progress full width on hover (#129832) ...
Related: #117567
What Problem This Solves
Skills and Hooks repeatedly implement the same Gateway fallback decisions, while Hook enable and disable maintain duplicate configuration-mutation paths. The duplication makes future regressions in explicit Gateway authority, offline discovery, and ownership-safe mutation unnecessarily likely.
Why This Change Was Made
Consolidate exact offline and older-Gateway eligibility in the existing lazy CLI Gateway facade, centralize repeated Skills RPC request envelopes, and give Hook toggling one canonical read/modify/write owner. Preserve configured and environment-selected Gateway authority, credential-free local discovery, exact legacy read compatibility, exclusive mutation locking, CLI identity, timeout behavior, and cold-start import boundaries. Production code decreases by 59 lines and the Hook assertion-safety baseline drops from two assertions to one.
User Impact
No intentional behavior change. Skills, Hooks, curator operations, and Workshop proposals keep their current behavior while their shared ownership rules become smaller and less likely to diverge.
Evidence