Skip to content

fix(network): restore model-driven body fetch flow#57

Open
lynnswap wants to merge 7 commits intocodex/dom-graph-store-ssotfrom
codex/refactor/network-body-auto-fetch
Open

fix(network): restore model-driven body fetch flow#57
lynnswap wants to merge 7 commits intocodex/dom-graph-store-ssotfrom
codex/refactor/network-body-auto-fetch

Conversation

@lynnswap
Copy link
Owner

@lynnswap lynnswap commented Mar 6, 2026

Purpose

  • restore network body fetching to a model-driven selected-entry flow
  • treat missing network body APIs as an engine readiness contract issue
  • keep transient body-agent unavailability recoverable inside the engine instead of the UI

Main changes

  • restore selected-entry body fetch orchestration in WINetworkModel, including attach-time follow-up for the current selection
  • add NetworkBodyFetchResult plus body-fetch readiness probing, self-heal, and a one-time in-engine retry path in NetworkPageAgent and NetworkSession
  • cancel stale selected-entry body fetches when selection changes or the session detaches
  • remove UIKit and AppKit body fetch triggers so detail and preview views stay display-only
  • update engine, integration, and UI coverage for selected-entry fetch flow, transient agent recovery, and stale-fetch cancellation
  • align the AppKit long integration toolbar expectation with the current network toolbar layout

Testing

  • mcp__XcodeBuildMCP__test_sim (WebInspectorEngineTests, iPhone 17, latest iOS)
  • mcp__XcodeBuildMCP__test_sim (WebInspectorIntegrationTests, iPhone 17, latest iOS)
  • mcp__XcodeBuildMCP__test_sim (WebInspectorUITests, iPhone 17, latest iOS)
  • mcp__XcodeBuildMCP__test_sim (WebInspectorIntegrationLongTests, targeted AppKit toolbar expectation update; no executable tests on iOS simulator because the case is #if canImport(AppKit))
  • codex-review --base origin/codex/dom-graph-store-ssot

Screenshots

  • Not included (no intentional visual UI changes)

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9565d06356

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4452cc0444

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78a23bcf6b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lynnswap lynnswap changed the title refactor(network): drive body fetch from visible UI fix(network): restore model-driven body fetch flow Mar 6, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df5dc1184e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +170 to +171
requiresReferenceAPI: hasReference,
requiresHandleAPI: hasHandle

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip handle API repair when reference fallback is available

When a body has both a ref and a handle, performBodyFetch can successfully fall back to getBody(ref, ...) if getBodyForHandle is missing, but this call still declares requiresHandleAPI: hasHandle. In legacy bridge configurations where handle APIs are intentionally absent, that makes ensureBodyFetchAvailability run repair (reinjection + reconfigure) before every fetch even though reference fetch would already work, adding avoidable script churn and latency on normal body loads.

Useful? React with 👍 / 👎.

Comment on lines +215 to +216
case .fetching, .full, .failed:
return false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow retries after transient body-unavailable results

A bodyUnavailable result is made terminal because fetches mark the body failed and shouldFetch permanently rejects .failed states. Fresh evidence: the JS agent returns null for unauthorized control-token calls in network-agent-core.ts, and bootstrap/configure eval failures are logged-and-continued in the attach path, so attach-time token/bootstrap hiccups can surface as temporary bodyUnavailable; with this gate, those bodies remain stuck failed for the rest of the session because no subsequent selected-entry fetch can retry.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant