Skip to content

fix(agent): preserve edge registration ownership in v1.7 - #1166

Merged
scttbnsn merged 1 commit into
dev/v1.7from
fix/v1.7-edge-registration-ownership
Sep 10, 2026
Merged

scttbnsn merged 1 commit into
dev/v1.7from
fix/v1.7-edge-registration-ownership

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

fix(agent): forward-port edge registration ownership to v1.7

Carry the reviewed fix from merged 1.6 PR #1161 (64a0e1e7e67830c8f656c73648700a7f8fb4afe7) into the maintained 1.7 line. An edge connection could disconnect while its component initialization was waiting, then publish its retired watcher over a replacement connection's component. The retired caller could also attempt name-wide rollback against the replacement.

Changes

  • Pass an optional owner-validity check through edge component synchronization and registration. Check before name-wide deregistration, after awaited boundaries, and before shared registry/cache publication. A retired initializer disposes only its own component and never rolls back the replacement by name.
  • Reject disconnected Docker proxy, log, delete, and exec requests before allocating request state or sending frames. A rejected log stream reports its error synchronously and returns an inert cancel handle. Native handshake callers retain their existing unguarded contract.
  • Add a real 1.7 inventory-seed regression alongside the reviewed 1.6 lifecycle cases. The new case holds the actual GET /containers/json?all=true sent through the loopback bridge, disconnects the adapter, and registers its replacement. It does not pause bridge initialization or invoke concurrent client synchronization directly.
  • Preserve 1.7's exec-end reason callback, throwing-callback cleanup during disconnect, same-adapter FIFO ordering, and exact-instance registry cleanup and identity-change pruning. Add only the ownership-fix Unreleased bullet; historical release notes are unchanged.

The diff is seven files, +500/-6 against dev/v1.7 at ad04f8b7fa5e847ae120fec812434395242803cc. Head is 7526dc465c8f7eae399f4be84651e63a7dcc01a3. This contains no 1.6 release metadata, dependency changes, or workflow edits. All six workspace installs were restored to their existing 1.7 manifests and locks without changing those files.

Verification

  • The new natural-seed regression first failed on the unchanged 1.7 runtime because the retired client's watcher snapshot was published. It passes with the ported ownership fix.
  • 901 tests across seven focused suites pass. AgentClient, EdgeAgentAdapter, and registry each have 100% statements, branches, functions, and lines: 1,629 statements, 1,168 branches, 271 functions, and 1,601 lines in total.
  • Backend build, Biome, whitespace checks, and commit hooks pass. Historical 1.7 changelog content is byte-preserved.
  • The compiled, bounded fake-wire diagnostic passes all three child processes: single synchronization, same-adapter repeated synchronization, and disconnect/replacement during natural inventory seeding. The retired owner remains unpublished, the replacement survives, and normal fleet cleanup leaves only the two standard-output PipeWrap resources. There are no remaining bridges, cron timers, or real Docker requests.
  • Normal full push gate passed on exact 7526dc465c8f7eae399f4be84651e63a7dcc01a3 in 311.36 seconds: 13,832 backend tests across 425 files and 4,791 UI tests across 228 files, both with 100% coverage; both builds, 215 script tests, 263 workflow tests, UI typecheck, Biome, knip, static scans, and workflow security checks passed. The remote branch matches the exact head. The UI build regenerated two pre-existing Lucide icon definitions; only that generated local drift was restored to the committed bytes, with no product change included. The checkout is clean and all owned gate processes have exited.

Hosted fleet verification

Fleet soak 34424059769 passed all six assertions: eight agents connected, 48 exec sessions/output frames, slow-consumer reconnect and two recovered reconnect storms. RSS growth was 8,450,048 bytes within 128 MiB; controller heap growth was 1,616,312 bytes within 64 MiB. The tested merge commit 3f1ab294ee066f62af2540783f4ffe058d3e4dcb has tree 52f3eeac3e8e51bd31529c9c3bc6138051542fde, exactly matching this PR head. Portwing was unchanged at d6ba7a9255e4a12418ffa6ac7ff8c21de6560a18.

Results finished at 01:08:09.707Z, the process step exited successfully by 01:08:12Z, and the job completed at 01:08:19Z. No retained process tail or forced-success exit was observed. These hosted resource measurements precede cleanup and are not a post-cleanup handle census; that separate proof is the bounded compiled diagnostic above. Artifact 10132017859 was fetched and its archive hash verified against the published SHA-256 digest 93dbad20642810f04e088d4d441b8d09fe1efda1cde851ea121f2bb587cad583.

All 11 required checks pass or correctly skip on this exact head. CI Verify passed, including coverage in 10m58s, build in 6m30s, Cucumber in 5m01s and image scanning. Playwright passed in 8m52s. Actual first CodeRabbit review summary 5611105402 was updated at 2026-09-10T08:21:34Z, run 1ece9fff-e66d-4d84-9c71-5abd2257bbf9, covering exact ad04f8b to 7526dc4 across all six source/test files. It reported no actionable findings or similarity skips and minimal risk. Request 5615355519 and reply 5615400260 were fetched; no second review was needed. Greptile's request alone remains no review evidence.

After independent verification of published v1.6.1-rc.13 completed, #1166 merged at 2026-09-10T17:00:46Z as c597842df72b820d120c346cafb9aac90dc7cfda. Its full tree 52f3eeac3e8e51bd31529c9c3bc6138051542fde exactly matches reviewed head 7526dc4. No new release is cut by this runtime merge.

Release impact

The published v1.7.0-rc.14 image does not contain this runtime fix and remains held from promotion. This PR does not cut a release or edit candidate identities. Including the fix requires a fresh candidate, exact-source release checks, artifact verification, and a fresh seven-day soak measured from that candidate's actual publication. RC15 metadata preparation is now in #1169. The 1.8 forward-port is prepared locally after this reviewed landing and has not merged.

Review scope: legitimate disconnect/reconnect races and abandoned in-flight work in the controller/edge lifecycle. No new registration subsystem or cross-repository wire contract is introduced.

@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
drydock-website Ready Ready Preview Sep 10, 2026 1:05am UTC
drydockdemo-website Ready Ready Preview Sep 10, 2026 1:05am UTC

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 1ece9fff-e66d-4d84-9c71-5abd2257bbf9

📥 Commits

Reviewing files that changed from the base of the PR and between ad04f8b and 7526dc4.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md
📒 Files selected for processing (6)
  • app/agent/AgentClient.test.ts
  • app/agent/AgentClient.ts
  • app/agent/EdgeAgentAdapter.test.ts
  • app/agent/EdgeAgentAdapter.ts
  • app/agent/edge-registration-ownership.test.ts
  • app/registry/index.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The change adds ownership validation to registry component registration and agent component synchronization. Retired edge agents stop registration, cache publication, and rollback of replacement owners. Disconnected adapters reject request and stream operations before allocating state or sending frames. Tests cover registration races, cleanup failures, replacement ordering, and disconnected request behavior.

Suggested labels: second-opinion

Merge Risk: ⚪ Minimal · up to 7526d

This change prevents retired edge connections from publishing stale state and rejects work after disconnect. Reported validation passes, with no actionable merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/v1.7-edge-registration-ownership

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@scttbnsn

Copy link
Copy Markdown
Contributor Author

@greptileai Review exact head 7526dc465c8f7eae399f4be84651e63a7dcc01a3. Check the 1.7 port of reviewed #1161 for stale registration publication and rollback, disconnected request allocation, and preservation of exec-end callbacks and exact-instance cleanup. Threat model: legitimate controller/edge reconnect races and abandoned in-flight work, not hostile local maintainers. Check the natural inventory-seed regression and same-adapter FIFO without adding a registration subsystem.

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttbnsn

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot added the second-opinion Summon Greptile for a second-opinion review label Sep 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@greptileai Review exact head 7526dc465c8f7eae399f4be84651e63a7dcc01a3. Review for correctness, security issues, and cross-file regressions.

This branch was successfully deployed

2 active deployments
Preview – drydock-website — 7526dc46 Deployed Sep 10, 2026 by vercel[bot]
Preview – drydockdemo-website — 7526dc46 Deployed Sep 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

second-opinion Summon Greptile for a second-opinion review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant