Skip to content

[codex] Keep prefetched brand pages previewable#4530

Open
PerishCode wants to merge 6 commits into
even-ferryfrom
codex/prefetch-page-preview
Open

[codex] Keep prefetched brand pages previewable#4530
PerishCode wants to merge 6 commits into
even-ferryfrom
codex/prefetch-page-preview

Conversation

@PerishCode

Copy link
Copy Markdown
Contributor

Why

This PR keeps prefetched brand pages previewable on top of #4260.

The pain being addressed is brand extraction reliability: terminal status reconciliation and prefetch persistence need to preserve enough page material for preview/debug flows instead of losing the page once extraction settles.

What users will see

In the #4260 Brand Kit flow, prefetched brand pages remain available for preview while terminal extraction statuses reconcile more consistently.

Surface area

  • UI — new page / dialog / panel / menu item / setting / empty state in apps/web or apps/desktop (including Electron menu bar)
  • Keyboard shortcut — new or changed
  • CLI / env var — new od subcommand or flag, new tools-dev / tools-pack / tools-pr flag, or new OD_* env var
  • API / contract — daemon brand extraction/prefetch behavior
  • Extension point — new entry under skills/, design-systems/, design-templates, or craft/, or change to the skills protocol
  • i18n keys — added new translation keys (see TRANSLATIONS.md for the locale workflow)
  • New top-level dependency — adding any new entry to the root package.json (dependencies or devDependencies); workspace-package package.json files are out of scope.
  • Default behavior change — Brand Kit extraction terminal-state and prefetch preview behavior changes in the Agent-driven brand extraction + two-loop memory overhaul #4260 flow
  • None — internal refactor, docs, tests, or translation update only

Screenshots

Not applicable.

Bug fix verification

Skipped. The branch includes focused daemon brand prefetch/routes tests, but I did not rerun them locally while opening this PR.

Validation

  • Not run locally; PR opened from the existing branch for review.

@lefarcen lefarcen requested a review from nettee June 18, 2026 13:04
@lefarcen lefarcen added size/M PR changes 100-300 lines risk/high High risk: apps/desktop, daemon, auth, migration, workflows, package deps type/feature New feature labels Jun 18, 2026
@lefarcen

Copy link
Copy Markdown
Contributor

Hey @PerishCode — quick heads-up that #4532 is also open from you against the same brand-extraction follow-up, and the changed-file set is currently identical across both PRs (brand-routes.ts, brands/index.ts, brands/prefetch.ts, brands/store.ts, plus the two daemon tests).

If these are meant to land together, consolidating into one PR will make review and merge much simpler.

@nettee nettee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found one blocking regression in the new brand-status reconcile path: it now treats any later canceled/failed run on the backing project as an extraction failure, so already-ready brands can be flipped back to failed after unrelated follow-up work.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

Comment thread apps/daemon/src/brand-routes.ts
@lefarcen

Copy link
Copy Markdown
Contributor

Hey @PerishCode — the current blocker to address is @nettee's review on this head: the new reconcile path is reading the latest project-wide run status, so a later canceled/failed follow-up run can flip an already-ready brand back to failed.

Once that persisted failure reconcile is scoped back to active extraction only — or tied to the specific extraction run instead of the latest project run — this should be in good shape for another pass.

💡 To drive this PR to merge hands-free, paste this to your AI coding agent (Claude Code / Codex / opencode / Cursor …):
Take over nexu-io/open-design#4530 until it merges — read https://raw.githubusercontent.com/nexu-io/looper/main/skills/pr-takeover/SKILL.md and follow it.

Generated-By: looper 0.9.10+codex.autoclean (runner=fixer, agent=codex)
@PerishCode

Copy link
Copy Markdown
Contributor Author

Looper fixer round completeab3cccd

  • ✅ Review comment on apps/daemon/src/brand-routes.ts:297 (@nettee) — thread
    • Restored the extraction-only guard in apps/daemon/src/brand-routes.ts before persisting failed/canceled reconcile, and updated apps/daemon/tests/brand-routes.test.ts so a ready brand with a later canceled follow-up run stays ready.

🔁 Powered by Looper · runner=fixer · agent=codex · An autonomous AI dev team for your GitHub repos.

@nettee nettee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found one remaining blocking hole in the status-reconcile change: the new guard protects ready brands, but active extractions are still matched against the latest project-wide run rather than the extraction run that owns the brand.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

Comment thread apps/daemon/src/brand-routes.ts Outdated
@lefarcen

Copy link
Copy Markdown
Contributor

Hey @PerishCode — the current blocker on this head is covered by @nettee's latest review: the ready-brand regression is fixed, but active extraction is still being reconciled against the latest project-wide run instead of the extraction run that owns the brand.

Once that reconcile path is tied to the extraction-owned run (or otherwise scoped so later unrelated project runs cannot drive extraction status), this should be ready for another pass.

Generated-By: looper 0.9.10+codex.autoclean (runner=fixer, agent=codex)
@PerishCode

Copy link
Copy Markdown
Contributor Author

Looper fixer round complete55d8562

  • ✅ Review comment on apps/daemon/src/brand-routes.ts (@nettee) — thread
    • Recorded the extraction conversation on BrandMeta and made brand status reconciliation use conversation-scoped run/input state in apps/daemon/src/brand-routes.ts. Added a two-conversation same-project regression in apps/daemon/tests/brand-routes.test.ts covering an extracting brand with a later canceled follow-up run.

🔁 Powered by Looper · runner=fixer · agent=codex · An autonomous AI dev team for your GitHub repos.

@nettee nettee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found one blocking correctness issue in the new conversation-scoped status lookup.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

Comment thread apps/daemon/src/db.ts Outdated
Generated-By: looper 0.9.10+codex.autoclean (runner=fixer, agent=codex)

@nettee nettee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found one remaining blocking correctness issue in the new conversation-scoped status lookup.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

Comment thread apps/daemon/src/db.ts Outdated
@lefarcen

Copy link
Copy Markdown
Contributor

Hey @PerishCode — the latest blocker on this head is the correctness issue @nettee called out in the conversation-scoped status lookup: listLatestConversationRunStatuses() still needs a deterministic latest-row selection so same-millisecond run-status messages can't flip extraction state nondeterministically.

Also, this PR now has user-visible refresh/status behavior changes, so I've marked it needs-validation — please hold off self-merging for now; once it reaches a merge-ready state, we'll route it through a QA pass before merge.

@lefarcen lefarcen added the needs-validation Runtime change detected; needs human or /explore agent validation. label Jun 18, 2026
Generated-By: looper 0.9.10+codex.autoclean (runner=fixer, agent=codex)
@PerishCode

Copy link
Copy Markdown
Contributor Author

Looper fixer round complete5c9e955

  • ✅ Review comment on apps/daemon/src/db.ts (@nettee) — thread
    • Updated apps/daemon/src/db.ts so listLatestConversationRunStatuses selects m.position and orders by updatedAt DESC, m.position DESC. Added a focused apps/daemon/tests/project-status.test.ts regression for same-timestamp conversation status rows.
  • • Review comment on apps/daemon/src/db.ts (@nettee) — thread
    • Agent did not provide a decision for this thread

🔁 Powered by Looper · runner=fixer · agent=codex · An autonomous AI dev team for your GitHub repos.

@nettee nettee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@PerishCode I reviewed the changed daemon reconcile path, the conversation-scoped status lookup, the prefetch preview fallback, and the focused regression coverage added on this head. The remaining ordering concern from the prior thread is addressed by the new conversation-position tie-breaker, and I did not find any further actionable issues in the changed ranges.

Nice cleanup on the follow-up fixes here.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

@lefarcen lefarcen requested a review from AmyShang-alt June 18, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-validation Runtime change detected; needs human or /explore agent validation. risk/high High risk: apps/desktop, daemon, auth, migration, workflows, package deps size/M PR changes 100-300 lines type/feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants