Skip to content

Improve Live polling responsiveness and reliability#371

Open
pbakaus wants to merge 1 commit into
mainfrom
codex/live-polling-improvements
Open

Improve Live polling responsiveness and reliability#371
pbakaus wants to merge 1 commit into
mainfrom
codex/live-polling-improvements

Conversation

@pbakaus

@pbakaus pbakaus commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • restore foreground/background polling as the primary Live control architecture across harnesses, including foreground one-shot polling for Codex
  • publish the first reviewable variant progressively through source-fenced artifacts, then deliver later variants and deferred Tune parameters without changing already-visible output
  • preserve picker position and make Accept/Discard immediate while safely canceling late generation
  • add Nuxt/Vue component previews alongside the existing Svelte path, plus stronger recovery, status, and source-lock behavior
  • harden the Live generator and detector against colored single-edge stripes, including the Astro inset-shadow regression from the failed run
  • add latency, provider, rendered-quality, and framework regression coverage

Architecture boundary

The experimental Codex app-server/worker runtime is intentionally excluded from this PR. It remains isolated on codex/live-app-server-experiment for future research. This branch keeps polling as the production path and retains only optimizations that are independent of that experiment.

Generated root harness/provider output is intentionally omitted under the repository's source-first policy.

Validation

  • bun run build:browser
  • bun run build:extension
  • bun run build
  • bun run test
  • bun run test:live-e2e — 32 tests across 24 runtime suites
  • focused detector, publication, benchmark, rendered-quality, Vue, Live reference, and server suites

Prepared with AI assistance under maintainer direction.


Note

High Risk
Changes core Live accept/source-locking, progressive publication, and multi-framework preview paths where races or marker leakage would corrupt user projects; benchmark scripts are additive but the skill/runtime behavior is production-critical.

Overview
Improves Live responsiveness and safety: Codex delegates generation to impeccable_live_generator and documents transactional progressive delivery via live-publish.mjs (fenced artifacts, publish-first variant 1) while other harnesses keep atomic single-edit by default. live.md adds event.scaffold reuse, Nuxt/Vue component-preview parity with Svelte, and updated polling/carbonize guidance.

live-accept.mjs gains source locks, idempotent accept receipts, and dedicated source-artifact, Vue, and existing Svelte accept/discard paths so Accept can fence concurrent generation.

The regex engine adds scanInsetStripeCss for chromatic inset box-shadow edge stripes (including Astro <style> blocks), aligned with the generator’s no-stripe rule.

New bench:live / bench:live:providers scripts and shared libs measure init, interaction latency, multi-provider strategies, rendered-quality judging, and atomic vs progressive comparisons; the test suite list expands for benchmarks, publication, Vue, and related Live tests.

Reviewed by Cursor Bugbot for commit c6ac34b. Bugbot is set up for automated code reviews on this repo. Configure here.

Restore foreground/background polling as the primary harness architecture, add progressive publication and framework-safe previews, and harden quality and regression coverage. The experimental app-server runtime is intentionally excluded.\n\nPrepared with AI assistance under maintainer direction.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying impeccable with  Cloudflare Pages  Cloudflare Pages

Latest commit: c6ac34b
Status: ✅  Deploy successful!
Preview URL: https://b1bbcabb.impeccable-2rv.pages.dev
Branch Preview URL: https://codex-live-polling-improveme.impeccable-2rv.pages.dev

View logs

@pbakaus
pbakaus marked this pull request as ready for review July 16, 2026 01:52
Copilot AI review requested due to automatic review settings July 16, 2026 01:52

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c6ac34b. Configure here.

if (index === -1) out[body] = true;
else out[body.slice(0, index)] = body.slice(index + 1);
}
return out;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Benchmark CLI ignores spaced flags

Medium Severity

The new bench:live script’s parseArgs treats any --name without = as boolean true and never reads the next argv token. Flags like --fixture vite8-react-plain, --output path, or --agent llm therefore resolve to the string "true" instead of the intended value, so runs target the wrong fixture or write to the wrong path.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c6ac34b. Configure here.

const index = (sorted.length - 1) * p;
const lower = Math.floor(index);
const upper = Math.ceil(index);
return Math.round((sorted[lower] * (1 - (index - lower)) + sorted[upper] * (index - lower)) * 100) / 100;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Control bench crashes empty metrics

Low Severity

After the e2e loop, summarize and percentile assume at least one numeric sample. If the metrics JSONL file is missing rows (misconfigured IMPECCABLE_E2E_METRICS_FILE or no recorded timings), sorted[0] and sorted.at(-1) are undefined and the script throws instead of reporting an empty result.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c6ac34b. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown

Greptile Summary

This PR reworks Live mode around durable polling and progressive preview publication. The main changes are:

  • Restored foreground/background polling as the primary Live control path.
  • Added transactional progressive publication through source-fenced artifacts.
  • Added Nuxt/Vue component previews alongside the existing Svelte preview path.
  • Improved Accept, Discard, recovery, status, source-lock, and late-generation cancellation handling.
  • Added Live benchmarks and expanded detector, rendered-quality, provider, Vue, and regression tests.

Confidence Score: 4/5

Mostly safe, with one contained Vue accept-path bug to fix.

The polling and publication flow is fenced and covered, but the Vue accept inliner can write accepted source that drops required root attributes.

skill/scripts/live/vue-component.mjs

T-Rex T-Rex Logs

What T-Rex did

  • Executed a focused Node repro that scaffolds a Vue component session with disabled, required, v-cloak, data-tracking, and class on the original selected root.
  • The generated variant with the same root but without the boolean or shorthand attributes was accepted, and the accepted source preserved the valued data-tracking attribute and merged class while dropping disabled, required, and v-cloak.
  • Reviewed the end-to-end harness run log showing nuxt-vite7, vite8-react-brand-fidelity, and vite8-sveltekit completing the cycle with zero failures and exit code 0.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
skill/scripts/live/vue-component.mjs Adds Nuxt/Vue SFC preview scaffolding and accept inlining; boolean root attributes are not preserved during accept.
skill/scripts/live/generation-publisher.mjs Adds transactional progressive artifact preparation and publishing with source fences and component-preview support.
skill/scripts/live-browser.js Updates Live browser UI and state handling for progressive arrivals, component previews, polling status, recovery, and immediate accept/discard.
skill/scripts/live-server.mjs Restores long-poll based server coordination with session journaling, checkpoints, and publication progress broadcasts.
skill/scripts/live-accept.mjs Extends accept/discard handling for source artifacts and framework component previews with idempotent receipts.
skill/reference/live.md Updates Live operator guidance for polling, Codex progressive delivery, and Vue component previews.
skill/agents/impeccable-live-generator.md Adds a compact generator-agent contract for Codex progressive publication.
cli/engine/engines/regex/detect-text.mjs Adds structural CSS scanning for chromatic inset stripe anti-patterns in CSS, style blocks, and CSS-in-JS.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant B as Browser Live UI
participant S as live-server.mjs
participant P as live-poll.mjs
participant G as Live generator
participant Pub as live-publish.mjs
participant Store as session-store
B->>S: POST /events generate
S->>Store: append generate
P->>S: GET /poll
S-->>P: leased generate event + scaffold
P->>G: delegate generation
G->>Pub: --prepare source/manifest
Pub->>Store: read epoch/source fence
G->>Pub: publish arrived variant prefix
Pub->>Store: append variant_published
S-->>B: SSE variant_progress
B->>S: POST checkpoint / accept / discard
S->>Store: fence or complete session
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant B as Browser Live UI
participant S as live-server.mjs
participant P as live-poll.mjs
participant G as Live generator
participant Pub as live-publish.mjs
participant Store as session-store
B->>S: POST /events generate
S->>Store: append generate
P->>S: GET /poll
S-->>P: leased generate event + scaffold
P->>G: delegate generation
G->>Pub: --prepare source/manifest
Pub->>Store: read epoch/source fence
G->>Pub: publish arrived variant prefix
Pub->>Store: append variant_published
S-->>B: SSE variant_progress
B->>S: POST checkpoint / accept / discard
S->>Store: fence or complete session
Loading

Fix All in Codex Fix All in Claude Code

Reviews (1): Last reviewed commit: "Improve Live polling responsiveness and ..." | Re-trigger Greptile

Comment on lines +277 to +280
function parseStaticAttrs(attrs) {
const out = new Map();
const re = /([A-Za-z_:][\w:.-]*)\s*=\s*(["'])(.*?)\2/g;
let match;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Boolean attrs are dropped
inlineVueComponentAccept uses parseStaticAttrs to merge the original root attributes back into the accepted Vue template, but this parser only records name="value" attributes. When the picked Vue root has required boolean or shorthand attributes such as disabled, required, or v-cloak, Accept drops them if the generated variant omits them, so the accepted source no longer preserves the original component contract.

Context Used: AGENTS.md (source)

Artifacts

Repro: focused Node script for boolean and shorthand Vue root attributes

  • Contains supporting evidence from the run (text/javascript; charset=utf-8).

Repro: command output showing valued attrs preserved while disabled, required, and v-cloak are dropped

  • Keeps the command output available without making the summary code-heavy.

View artifacts

T-Rex Ran code and verified through T-Rex

Fix in Codex Fix in Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR substantially reworks Impeccable Live’s polling and publication/accept workflow to improve responsiveness and reduce race conditions, while expanding framework support (Nuxt/Vue component previews) and hardening the detector against inset-shadow “single-edge stripe” regressions. It also adds benchmark and rendered-quality evaluation utilities plus broader regression coverage.

Changes:

  • Restore/standardize foreground/background polling behavior (including type-lane filtering), and harden session journaling/state transitions to fence late generation after Accept/Discard.
  • Introduce progressive publication primitives (artifact preparation/publish flow) plus accept/source-locking and idempotent accept receipts.
  • Add Nuxt/Vue component preview path alongside Svelte component preview, plus new benchmarks/rendered-quality tooling and fixtures/tests for regressions.

Reviewed changes

Copilot reviewed 73 out of 74 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/live-wrap.test.mjs Adds regression coverage for isolated source previews and safer ambiguity handling.
tests/live-vue-component.test.mjs New Nuxt/Vue component preview tests covering scaffold, accept, publish fencing, and cleanup.
tests/live-session-store.test.mjs Expands session journal/state tests for progressive publication, fencing, and timing telemetry.
tests/live-rendered-quality.test.mjs New unit tests for rendered-quality prompt/context parsing and scoring summaries.
tests/live-reference.test.mjs Tightens authoring contract expectations for Live reference routing and Codex-specific guidance.
tests/live-provider-benchmark.test.mjs New benchmark scoring/aggregation tests for provider comparisons and cleanup gates.
tests/live-poll.test.mjs Adds polling lane normalization and new reply payload fields/agent-reply types.
tests/live-inject.test.mjs Adds Nuxt adapter injection/remove/idempotency tests and conflict behavior.
tests/live-generation-preflight.test.mjs New tests for generation preflight command construction and output shaping.
tests/live-event-validation.test.mjs Adds validation coverage for worker progress/telemetry event types.
tests/live-e2e/ui.mjs Improves E2E UI helpers (action picker selection, richer diagnostics, arrival logic).
tests/live-e2e/session.mjs Extends fixture boot/session orchestration (progressive runs, tracing, install hardening).
tests/live-e2e/agents/llm-agent.mjs Adds progressive-generation guidance/validation and optional spec inclusion for benchmarks.
tests/live-e2e-llm-agent.test.mjs Adds unit tests for progressive prompt guidance and new validation helpers.
tests/live-e2e-agent-output.test.mjs Adds helper test for recognizing expected “late generation” cancellation errors.
tests/live-browser-source.test.mjs Strengthens source-level assertions around poll connectivity, Vue module routing, and progressive checkpoints.
tests/live-browser-regression.test.mjs Expands regression guards for discard behavior, anchor preservation, progressive readiness, Tune param refresh, and component preview gating.
tests/live-benchmark.test.mjs New benchmark library tests for metrics, progressive assembly, and report comparisons.
tests/live-accept.test.mjs Adds isolated source artifact accept/discard tests and accept receipt replay/conflict coverage.
tests/framework-fixtures/vite8-sveltekit/files/src/routes/+page.svelte Updates fixture to include styling for Live UI stability.
tests/framework-fixtures/vite8-react-brand-fidelity/gitignore.txt New fixture ignore rules for brand-fidelity benchmark fixture.
tests/framework-fixtures/vite8-react-brand-fidelity/fixture.json New brand-fidelity fixture configuration including rendered-quality metadata.
tests/framework-fixtures/vite8-react-brand-fidelity/files/vite.config.js New fixture Vite config for predictable dev server behavior.
tests/framework-fixtures/vite8-react-brand-fidelity/files/src/styles.css New fixture design tokens + baseline styling for fidelity checks.
tests/framework-fixtures/vite8-react-brand-fidelity/files/src/main.jsx New fixture entrypoint wiring React app.
tests/framework-fixtures/vite8-react-brand-fidelity/files/src/App.jsx New fixture component for offer-card and ActionLink contract.
tests/framework-fixtures/vite8-react-brand-fidelity/files/PRODUCT.md New fixture product context for Live.
tests/framework-fixtures/vite8-react-brand-fidelity/files/package.json New fixture dependencies for React/Vite.
tests/framework-fixtures/vite8-react-brand-fidelity/files/index.html New fixture HTML shell.
tests/framework-fixtures/vite8-react-brand-fidelity/files/DESIGN.md New fixture design system constraints for fidelity gating.
tests/framework-fixtures/README.md Documents Nuxt fixture and external fixture usage for benchmark tooling.
tests/framework-fixtures/nuxt-vite7/fixture.json Promotes Nuxt fixture to runtime-capable via adapter/plugin approach.
tests/framework-fixtures/nuxt-vite7/files/nuxt.config.ts Updates Nuxt fixture config (including compatibility date).
tests/framework-fixtures/nuxt-vite7/files/app/pages/index.vue New Nuxt app-directory page fixture.
tests/framework-fixtures/nuxt-vite7/files/app/app.vue New Nuxt app root fixture.
tests/framework-fixtures/nuxt-vite7/files/app.vue Removes legacy root app.vue fixture layout.
tests/framework-fixtures.test.mjs Updates fixture assertions for new Live artifacts/receipts/locks and Nuxt plugin adapter behavior.
tests/fixtures/antipatterns/astro-inset-shadow-stripe.astro New fixture for Astro inset-shadow single-edge stripe regression.
tests/detect-antipatterns-fixtures.test.mjs Adds Astro structural CSS fixture assertions for inset-shadow stripe detection.
skill/scripts/live/vue-component.mjs New Nuxt/Vue component preview scaffold/accept/cleanup implementation.
skill/scripts/live/source-lock.mjs New per-source-file locking helper for accept/publish critical sections.
skill/scripts/live/source-artifact.mjs New isolated source preview manifest/session helpers.
skill/scripts/live/session-store.mjs Expands session snapshot model and fences late generation/publication events.
skill/scripts/live/poll-lanes.mjs New event prioritization and selection logic for poll lanes.
skill/scripts/live/generation-preflight.mjs New helper to precompute scaffold metadata via wrap/insert for generation.
skill/scripts/live/event-validation.mjs Adds schema validation for new progress/cleanup events.
skill/scripts/live.mjs Updates Live top-level guidance to emphasize harness-native poll loop setup.
skill/scripts/live-wrap.mjs Adds Vue component previews, isolated source artifact mode, and safer ambiguity refusal behavior.
skill/scripts/live-status.mjs Refactors recovery hint composition.
skill/scripts/live-publish.mjs New CLI wrapper for prepare/publish generation artifacts.
skill/scripts/live-poll.mjs Adds type filtering, accept reply metadata, and lane normalization.
skill/scripts/live-inject.mjs Adds Nuxt adapter support via dev-only client plugin + expanded ignore patterns.
skill/scripts/live-accept.mjs Adds source locking, source-artifact + Vue accept paths, and idempotent accept receipts.
skill/agents/impeccable-live-generator.md New Codex-focused generator agent spec for progressive publication workflow.
scripts/test-suites.mjs Adds new Live benchmark/rendered-quality/Vue tests to suite list.
scripts/lib/live-rendered-quality.mjs New rendered-quality judging prompt/context/parsing utilities.
scripts/lib/live-benchmark.mjs New benchmark metrics and report comparison utilities (atomic vs progressive).
scripts/judge-live-rendered.mjs New CLI to run rendered-quality judging over artifact bundles.
scripts/compare-live-benchmarks.mjs New CLI to compare atomic/progressive benchmark reports against thresholds.
scripts/benchmark-live.mjs New Live benchmark runner for interaction latency and progressive delivery.
scripts/benchmark-live-init.mjs New initialization benchmark runner for cold/warm Live startup.
scripts/benchmark-live-control.mjs New control benchmark runner for E2E-derived latency metrics.
package.json Adds bench:live / bench:live:providers scripts.
cli/engine/engines/regex/detect-text.mjs Adds structural inset-shadow stripe scanning (including Astro <style> blocks).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1005 to +1007
function acceptReceiptPath(cwd, id) {
return path.join(getLiveDir(cwd), 'accept-receipts', `${id}.json`);
}
@github-actions github-actions Bot added blocked: review threads Unresolved review feedback or requested changes remain waiting on contributor Waiting for the PR author to respond or make changes labels Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked: review threads Unresolved review feedback or requested changes remain waiting on contributor Waiting for the PR author to respond or make changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants