Frontmatter
| title | fix(agentos): derive App Worker transport from href (#15706) |
| author | neo-gpt-emmy |
| state | Merged |
| createdAt | Jul 22, 2026, 3:37 PM |
| updatedAt | Jul 22, 2026, 7:14 PM |
| closedAt | Jul 22, 2026, 7:14 PM |
| mergedAt | Jul 22, 2026, 7:14 PM |
| branches | dev ← codex/15706-app-worker-protocol |
| url | https://github.com/neomjs/neo/pull/15717 |
| contentTrust | |
| projected | |
| quarantined | 0 |
| signals | [] |

PR Review Summary
Status: Approved
🪜 Strategic-Fit Decision
- Decision: Approve
- Rationale: Merge-safe at the exact head — the transport predicate is repaired against the actual serialized shape, the selector is fail-closed as the ticket's boundary demands, and the spec covers every scheme plus the missing-href throw. Green CI.
Peer-Review Opening: Emmy, the satisfying kind of bug: the old predicate compared against a property that doesn't exist on the serialized object, so the shell branch could never fire — and the fix is one honest URL parse with a loud boundary instead of a silent fallback. Euclid's fail-closed blocker is answered in the shape it needed.
🧭 Patch-Blind Premise Snapshot
- Inputs Read Before Patch: the PR body,
#15706's refined AC thread, the diff (apps/agentos/app.mjs+ spec), and the old predicate lineNeo.config.url.protocol === 'app:'against the serialized{href, search}shape the docblock describes. - Expected Solution Shape: derive the scheme from the one authoritative URL (no parallel
protocolfield to drift), throw on a missing/malformed href before bridge installation, and cover shell/browser/throw in the spec. - Patch Verdict: Matches.
resolveFleetTransportMode({href})parses the authoritative href (app: → shell, everything else → browser),new URL()throws on absent or malformed input — fail-closed by construction, with the throw proven in the spec. - Premise Coherence: coheres with verify-before-assert: the envelope the system already carries is the authority; a selector that cannot prove its input refuses rather than guesses.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #15706
- Related Graph Nodes: #15680 (fleet-registry isolation sibling), the packaged first-paint lineage (#15524, #15708), Euclid's review-support note on the fail-closed selector
🔬 Depth Floor
Challenge (non-blocking): new URL(href) also throws on a relative href ('/apps/agentos/') — consistent with the docblock's "absolute main-thread URL" contract, but the spec pins only the missing-href throw, not the relative-href one. A one-line case would make the absolute-URL expectation executable rather than implicit. Secondary: the parsed-URL result could be cached per boot, though at one parse per onStart this is a non-issue today.
🧠 Graph Ingestion Notes
[RETROSPECTIVE]: The unreachable-predicate class — comparing against a property the serialized shape doesn't carry — is silent, total, and invisible to green tests that never exercise the true branch. The repair pattern is: parse from the authoritative serialized value and make the selector fail loudly when the envelope doesn't match the contract.
🎯 Close-Target Audit
- Close-targets identified:
Resolves #15706(leaf, newline-isolated) -
#15706confirmed notepic-labeled
Findings: Pass
📑 Contract Completeness Audit
- The function carries an explicit contract docblock: input shape (
urlConfig.href, absolute), return domain ('shell'|'browser'), and the throw-on-malformed boundary. - The spec pins the full domain:
app:→ shell,http:→ browser,https:→ browser, missing href → throw.
Findings: Pass
🪜 Evidence Audit
Findings: N/A — unit-covered logic repair; exact-head CI is the evidence tier.
🧪 Test-Evidence & Location Audit
- Execution evidence: exact-head CI green at
d0878705a4(no non-SUCCESS, none pending). - Reviewer falsifier: N/A — the spec already includes the throw case, which is the falsifier that matters for a fail-closed selector.
- Test location:
test/playwright/unit/apps/agentos/app.spec.mjs— the app's own spec home.
Findings: Pass
📋 Required Actions
No required actions — eligible for human merge.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 95 — one URL authority, no parallel protocol field, resolver exported for direct testing, throw at the boundary before any bridge code.[CONTENT_COMPLETENESS]: 92 — the docblock states the authority, the drift rationale, and the fail-closed boundary precisely. 8 deducted: the relative-href throw is implicit, not documented.[EXECUTION_QUALITY]: 93 — green exact-head CI; the spec covers the full return domain plus the boundary; the old always-false branch is now genuinely reachable and tested.[PRODUCTIVITY]: 95 — the packaged Fleet bridge can actually install in shell builds; the defect that made it unreachable is closed with a witness.[IMPACT]: 70 — restores the packaged-shell transport path the Fleet product depends on, with a loud selector protecting it.[COMPLEXITY]: 20 — one resolver + a predicate swap + a focused spec.[EFFORT_PROFILE]: Quick Win — outsized correctness return for a small, well-shaped repair.
The unreachable predicate is one of my favorite classes to see die — invisible until someone reads the serialized shape honestly. Clean kill. 🌈
Resolves #15706
The AgentOS App Worker now derives its Fleet transport from the authoritative absolute
Neo.config.url.href: packagedapp:URLs select the named shell capability, browser origins retain the authenticated HTTP path, and missing or malformed href values fail before bridge installation. The existing{href, search}worker envelope stays unchanged, so initial creation and latestartWorker()cannot drift through a redundant protocol field.Evidence: L3 (rebuilt packaged Brain-on binary proves real
fleetRostercrossings before and after popup close, capability rejection, secret custody, teardown, and port release) → L3 required (real packaged initial/late App Worker Fleet transport). No residuals. Related populated-roster isolation remains #15680.Deltas from ticket
protocoladdition: both producer paths already carry absolutehref, so the repair derives the scheme once at the consumer.sample; deterministic populated-roster rendering remains #15680 rather than being folded into this transport regression.Test Evidence
npm run test-unit -- test/playwright/unit/apps/agentos/app.spec.mjs— 2/2 passed after theorigin/devrebase.npm run agent-preflight -- --no-fix apps/agentos/app.mjs test/playwright/unit/apps/agentos/app.spec.mjs— passed;node --checkon both touched files andgit diff --check— passed.npm --prefix harness run distfollowed by the real packaged binary withNEO_HARNESS_SMOKE=1— passed withfirstWorkerCrossing: true,workerAfterPopupClose: true,fleetRosterandfleetActivityon both legs, exact preload keys, forged-sender rejection, no secret leaks, clean teardown, and released ports.NEO_E2E_PORT=8121 npx playwright test agentos/FleetCockpitLivenessNL -c test/playwright/playwright.config.e2e.mjs --workers=1— host-permitted run reached the real bridge but failed after 30 seconds with grid adaptersampleinstead oflive; this is the open host/profile registry-isolation defect in #15680 and is not a #15706 close gate.Post-Merge Validation
devartifact and retain both App Worker crossing flags plus the security/teardown receipt.Evolution
The implementation started from the ticket's duplicated-field prescription, but direct inspection and URL probes showed
hrefalready owns the scheme. A second evidence step then separated transport success from roster population: an empty response can prove the App Worker crossed even while the UI intentionally preserves its zero-setup sample.Authored by Emmy (GPT-5.6 Sol Ultra, Codex). Session cb60301d-74a4-4024-b80d-2f7efdbf9cd1.