Repository navigation
refactor(gateway): refresh session discovery watches in place - #176786
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR refreshes session-source discovery in its existing memo, retains common watches, prunes unused watches, and removes unused synchronous preparation. Example: The ops database at /tmp/retired-watch/ops.sqlite is unregistered while main remains registered.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: it simplifies discovery ownership while preserving the measured watch-reuse benefit, and no actionable introduced defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway history preparation captures routing, registry entries, and physical candidates; the admitted history worker consumes those facts to resolve auxiliary lineage sources. flowchart LR
A[History request] --> B[Gateway discovery memo]
C[Registry snapshot] --> B
D[Directory observations] --> B
B --> E[Admitted history worker]
E --> F[Physical candidate validation]
F --> G[History projection]
Technical reviewBest possible solution: Retain the in-place discovery owner and its existing physical validation, cancellation, shutdown, and watch-pruning contracts. Do we have a high-confidence way to reproduce the issue? This is a behavior-preserving refactor; inspection confirms the retired-generation chain and unused synchronous acquisition on main, but no target code was executed. Is this the best way to solve the issue? The change uses the existing bounded memo and observation owner, removes the replaced path, and retains distinct lifecycle and physical-replacement coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d79b0a4df0b2. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -51, Tests +43. Total -8 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 18, 2026, 10:15 PM ET / October 19, 2026, 02:15 UTC. |
|
Exact head
The actual tested merge The automated classification compares an older scheduled main and therefore All 63 attempt jobs and 192 exact-head checks are terminal; independent |
What Problem This Solves
Auxiliary session-history source discovery hands shared watches through a chain
of retired cache generations and keeps an unused synchronous acquisition path.
User Impact
Normal history source selection, external-path refresh, cancellation and shutdown
retain their existing owners. Auxiliary topology can change between preparation
and receiver selection; physical-path and disclosure checks remain mandatory.
Why This Change Was Made
Refresh the existing bounded memo in place. One pending refresh shares its
outcome, retains intersecting watches, and prunes retired unique paths. Delete
the unused synchronous acquisition, unused returned currency closures, and
copies of prepared facts that the producer and receiver do not mutate.
This is one session-history discovery AREA recovered from the parked family,
not a replay of its wider changes. Three paths: production +55/-106, 51 net
lines removed; tests +90/-47, 43 net lines added. Whole packet: eight net lines
removed. The test growth adapts the existing synchronous cases to the actual
async acquisition and adds shared-rejection/next-request recovery coverage.
The worker resolver stays in its existing leaf owner.
No public config, protocol, SDK, persisted shape, schema, permission, retention,
durability or dependency change. Phase E standalone session memory, its factory,
registry, expiry, federation machinery and tests are wholly untouched.
Best-effort tradeoffs accepted
macOS watch-close stalls of 0.4–19 seconds. Keep that measured performance
benefit by retaining common watches directly; no generation custody is needed.
Failure, bounded eviction and root close still release owned observations.
has validated its canonical snapshot. Auxiliary topology may change afterward;
the receiver still validates captured physical candidates and primary/live
disclosure authority. The next request refreshes invalidated auxiliary facts.
caller. Its human coordination-visibility issue Subagent coordination leaks into chat and triggers peer reply loops #150488 does not require this
dead wrapper: actual history lineage remains on the async worker path.
production consumer serializes and forwards them without mutation; the worker
resolver likewise does not mutate them. Unsupported internal mutation is not
given a second copy/ownership protocol.
Evidence
Exact-head CI39187864520 attempt1 is failed, not green. The native inherited-only
exception is requested for the following independently attributed baseline break.
All eight failures have the same determining source pair, unchanged between actual
main baseline af1e1fe and tested merge003bc6badbba. CI's informational report
labels these new/unknown against an older scheduled main; actual signature/source
inspection and main repair #176799 establish the later inherited regression.
Main repair e070647 changes only the stale UI import to the existing cache
module. Its published main-baseline proof reproduces both diagnostics and the
build failure, then passes targeted UI types, four attention cases and UI build.
All three determining UI modules compare byte-identical between our actual CI
baseline, tested merge and that repair's recorded main baseline c2549f8.
No authored source-discovery path changes these modules. Aggregate117855806405
reports exactly these eight executable roots; all63 attempt jobs and192 exact-head
checks are terminal. Independent security-fast117854377690 passes; ancillary
cancelled auto-response has a successful same-head successor. No executable suite
is missing. The last six completed scheduled main failed-job maps and coordinator
flake register were checked; no matching missing-export entry exists. No CI rerun,
green repush, broad local build/typecheck or underlying-UI repair by this lane.
Independent P0-P2 review of the complete fixture-repaired cut completed
scoped-clean in one pass before the coordinator's tooling rebase. The entire
three-file diff and 34 complete source/context files verified unchanged around
that review. The rebase retains main's removal of the custom watcher recovery
interval; no receiver validation is removed. The shared target resolver has
return paths without a physical candidate check, so the final binding check stays.
Pre-rebase formatting passed (three files, 21ms); whitespace checks pass. Final producer
path/registry publication checks remain unchanged, including canonical snapshot
rejection. The adapted pending-publication case requires one shared rejection,
watch release, then successful fresh preparation; it does not promise stale
successful topology or weaken the registry witness.
The first migrated suite reported five failures. One serial exact-base production
control with the same adapted tests reproduced all five: 85 native reads against
the resolver's original 48 bound, three alias cases still allowing the legitimate
canonical fallback, and replacement of a missing-file parent without changing its
physical path string. This is adapted-test diagnosis, not inherited CI clearance.
The repair configures the selected alias, physically redirects the parent through
a symlink, and measures the unchanged original resolver budget after asynchronous
host capture. No numeric bound, timeout, assertion, retry or skip is relaxed.
The earlier repaired runtime attempt was stopped by the coordinator before a verdict.
After the tooling rebase, the refreshed isolated frozen install passes (191.05
seconds; all 1,577 packages reused). The full focused source-owner suite now
passes all 15 cases, including both replaced-candidate negative controls,
discovery budgets, warm zero-FS, watch reuse/pruning, root close, independent
cancellation and shared rejection/recovery. Vitest reports 443.55 seconds;
the isolated wrapper completes in 514.78 seconds, including worker preparation
(264.234 seconds, 16,759 inputs). The owner cases intentionally exercise real
physical-store/state lifetimes and bounded multi-agent discovery; this is not
a latency improvement claim. Current targeted native types pass (23.68 seconds).
The first official lint attempt used the custom targeted-type config, triggering
plugin-SDK declaration preparation that timed out at its unchanged 300-second
deadline before lint diagnostics. The wrapper explicitly supports a maintained
source-backed core config without that unrelated package preparation. Using that
config with the same three explicit files, type-aware lint passes (163.21 seconds).
Three-file formatting passes (49ms; 1.93 seconds wrapper), and the mandatory
suppression audit passes all 14 cases (40.87 seconds configuration; 75.39 seconds
wrapper). No lint rules, suppressions, retries or timeouts were changed.
The selected existing cross-agent dashboard history/disclosure integration case
also passes (49.958 seconds). It exercises worker history pages and deltas;
the other ten cases were excluded by name filter, not changed to skipped tests.
Vitest reports 201.53 seconds and the isolated wrapper completes in 325.61 seconds,
including reused worker preparation (56.582 seconds). Exact-head PR CI remains
pending after publication. No
performance improvement, live Gateway, deployment or real-state
proof is claimed. Broad architecture/build/platform proof belongs to PR CI.