Skip to content

feat(desktop): show Agent Graph output previews - #4751

Open
testikun wants to merge 7 commits into
apache:mainfrom
testikun:codex/issue-3714-agent-graph-v2
Open

feat(desktop): show Agent Graph output previews#4751
testikun wants to merge 7 commits into
apache:mainfrom
testikun:codex/issue-3714-agent-graph-v2

Conversation

@testikun

@testikun testikun commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Project a bounded 280-code-point output tail and usage-derived token rate from existing child Session RuntimeEvents and read models.
  • Carry optional fields through the strict Runtime Host decoder and Desktop Agent Graph panel; current protocol epoch moves from 136 to 137.
  • Preserve Open child task and existing graph scheduling, admission, execution, recovery, and child-session semantics.

Fixes #3714

Latest Verification

After merging main at f60fcb1: full build:test and full typecheck passed; 55 focused projection/read-model/protocol/panel tests and the graph boot integration regression passed. That earlier head passed GitHub CI. After main advanced to f091198, the epoch conflict was resolved; full build:test, 62 focused tests and the protocol guard passed again. Latest-head CI is pending. Durable completion and live output now both retain the bounded tail.

Screenshot Provenance

The previously supplied image shows the real Electron renderer using synthetic fixture data. It does not demonstrate live-provider measured TPS. No new visual verification was performed in this repair pass.

Electron renderer with synthetic Agent Graph data

Review Focus

RuntimeEvents remain the output and usage authority. The bounded projection is presentation-only. Per-delta projection writes remain an explicit tradeoff; no throttling abstraction was introduced.

AI Use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

OpenAI Codex implemented and repaired this change on behalf of testikun. This update is not an independent human review. Commits include Generated-by: OpenAI Codex.

Behavior Change

Yes: Agent Graph displays bounded output previews and usage-derived token rate.

@github-actions github-actions Bot added the effort/L Under 1000 readable lines label Sep 4, 2026
@testikun
testikun force-pushed the codex/issue-3714-agent-graph-v2 branch 6 times, most recently from 24b07e8 to c2124a0 Compare September 8, 2026 03:01

@Astro-Han Astro-Han 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.

Synthesis: GO, no P0–P2 (with 1 credibility note + 3 P3 observations)

This conclusion comes from @Ox-Qronos's independent review. I did not read this diff myself; I verified the current head has not drifted and the exact-head CI state.

What this diff actually does (16 files, three layers): per-operator bounded output previews (280 code points + 2KiB dual cap) with usage-derived TPS for Agent Graph projection; strict allowlist/decoder carriage of the optional output fields with compatibility epoch 133→134; Desktop panel rendering of live/result labels, TPS, and previews.

Credibility note on the PR body (not a code defect, but the author should know): the body claims the screenshot shows real output with measured TPS from a local build at ff866d713. Verification shows that commit only touches a coordinator test file (+35/-5) and contains no panel rendering (added 4 days later); the screenshot content matches storybook fixture data verbatim (session name, title, tokensPerSecond:42/18, mirrored story copy). So: real app window with synthetic data. Rendering itself matches the code path exactly, and feature validity is independently proven by local tests and hosted CI.

P3 observations:

  1. Write amplification tradeoff: every text delta now materializes one bounded projection commit plus invalidation (the old design explicitly asserted zero projection writes on deltas). Payloads are bounded and semantics correct, but commit volume on high-frequency streaming sessions is worth knowing. The author already declared this tradeoff in the review focus.
  2. Display semantic difference: durable rebuild truncates from the head while live streaming truncates from the tail, so the preview window flips from "start" to "end" on reconnect. Display layer only, authoritative data unaffected.
  3. Dead code: the ?? textEvents[0]!.ts fallback near projection.ts:346 is unreachable (latestText is guaranteed non-empty). Harmless.

Not covered: real-provider streaming TPS behavior (no live streaming environment here); whether the author validated with real data beyond fixtures (only proven inconsistent with the claimed head, intent not proven); lint/format/knip not run locally (hosted CI green governs).


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

@testikun

testikun commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. The unreachable textEvents[0]!.ts fallback has been removed; sampleStartedAt now uses the already-validated model text event directly. The fix is pushed in commit 153a20f5e. Local npm run build:test passes under Node 24, and the hosted CI check is running on the updated head.

@testikun
testikun force-pushed the codex/issue-3714-agent-graph-v2 branch from 153a20f to e3995ab Compare September 9, 2026 02:45
testikun and others added 5 commits September 9, 2026 10:48
Project bounded child output and usage-derived throughput from existing RuntimeEvent facts into the Agent Graph read model, then render streaming and completed previews without changing graph execution semantics.

Generated-by: OpenAI Codex
Replace the obsolete no-delta-write assertion with bounded streaming projection and one-invalidation-per-commit coverage.

Generated-by: OpenAI Codex
@testikun
testikun force-pushed the codex/issue-3714-agent-graph-v2 branch from e3995ab to 44366b7 Compare September 9, 2026 02:48

@Astro-Han Astro-Han 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.

Re-verification on new head: GO stands, P3③ fixed

This follows up the review above. The PR has since moved to a new head with exactly one commit (fix(runtime): remove unreachable output timestamp fallback), which removes the dead-code fallback this review flagged as P3③. This conclusion comes from @Ox-Qronos's re-verification. I did not read this diff myself; I verified the head binding and the exact-head CI state below.

  • The removal is behavior-preserving (the preceding guard guarantees a non-empty model text event, so the fallback was unreachable).
  • Prior GO verdict (no P0–P2), the credibility note, and the remaining two P3 observations carry over unchanged.
  • Exact-head test is green on this head.

Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

Merge current main, advance the strict protocol epoch to 136, and consistently retain the bounded output tail. Remove the now-unnecessary head/tail option and cover streamed completion and immutable rebuild.

Generated-by: OpenAI Codex
@testikun

Copy link
Copy Markdown
Contributor Author

Automated follow-up by OpenAI Codex on behalf of testikun (not an independent human review).

Pushed 15d7f89, merging current main and advancing compatibility from 135 to 136. Live, completed, and rebuilt previews now consistently retain the bounded tail; removed the unnecessary head/tail selector and added regressions. The per-text-delta projection-write tradeoff remains explicit: this patch does not introduce a second throttling lifecycle or change graph execution authority.

Validation: full build:test and typecheck; 55 focused projection/read-model/protocol/Host/Desktop tests and the graph boot/recovery integration case passed. diff against main passes whitespace checks.

Correction to earlier evidence: the existing screenshot demonstrates a real Electron renderer with synthetic fixture data, not independently measured live-provider TPS. The old ff866d7 attribution does not prove the later panel implementation. No real-provider TPS claim is made by this verification.

Merge latest main and retain its epoch 136 contract; graph output extends epoch 137.

Generated-by: OpenAI Codex
@testikun

Copy link
Copy Markdown
Contributor Author

Automated follow-up by OpenAI Codex on behalf of testikun. Main advanced during this repair and #5117 now owns epoch 136. Resolved the resulting conflict against main f091198: retain upstream epoch history and move the Agent Graph output extension to 137. Full build:test, 62 focused Graph projection/read-model/Desktop/protocol tests and the protocol epoch guard (136 -> 137) pass. Latest head 0dae287 is pushed. The earlier CI success belongs to the previous head; this update needs a fresh run and human review.

@Astro-Han Astro-Han 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.

Re-verification on new head: GO stands

This follows up the reviews above. The PR has since moved to a new head containing two main merges plus three author-side changes. This conclusion comes from @Ox-Qronos's re-verification, rebuilt and re-run locally (5 suites green). I did not read this diff myself; I verified the head binding and the exact-head CI state below.

  • Unified tail truncation (both durable and live paths now take the last 280 code points without trim) resolves the previously noted P3② display inconsistency, in the right direction and covered by tests.
  • Panel visibility call updated for main's refactor; no behavior concern.
  • Exact-head test is green on this head.

One action needed before merge: the declared compatibility epoch (137) is already taken on main (now at 141), so another rebase with a fresh epoch stamp will be required — the gate will enforce it, do not let it linger.

  • Prior GO verdict (no P0–P2) and remaining observations carry over.

Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

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

Labels

effort/L Under 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(desktop): Agent Graph 节点 TPS 与输出 preview

2 participants