Skip to content

FE-1943: Show where each Brunch exchange's time goes in persona runs - #10066

Merged
lunelson merged 13 commits into
ln/fe-1960-brunch-plugin-chatfrom
ln/fe-1943-shorten-turn-times
Oct 23, 2026
Merged

lunelson merged 13 commits into
ln/fe-1960-brunch-plugin-chatfrom
ln/fe-1943-shorten-turn-times

Conversation

@lunelson

@lunelson lunelson commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

Every Brunch persona run and one-turn probe now ends with a run packet that accounts for where each exchange's time went. That is the measurement FE-1943 judges turn-time changes by. The persona launcher also gains a message limit, so runs can be compared over the same number of exchanges, and two bugs that stalled or cut short those runs are fixed.

This PR carries the measuring tools only. The guidance variants under test (batched steps, reply first) are not in it.

🔗 Related links

🔍 What does this change?

  • Run packets. evidence/packet.json and evidence/packet.md record, per exchange: active time (wall time less approval waits), time to the first reply text, model steps split into hidden reasoning, tool-argument streaming and reply text, each step's shape by tool category, the tool mix, skill activations and reloads, context compactions, Ledger commit sizes, net growth, tokens and cost. yarn workspace @apps/brunch-agent packet:run <run-dir>… writes or refreshes packets for retained runs without spending model turns.
  • --max-messages <n> stops a persona run once Brunch has replied to the persona's nth message. The opening is not counted.
  • Approvals under the React Compiler. When one step held two destructive calls, the second approval never showed and the turn hung. The compiler had memoized the approval tools on a version counter it never read, so their identity never changed. The tools are now built from an immutable snapshot of the waiting calls, read through useSyncExternalStore, so each new call gets its approval.
  • Ctrl-C in the launcher. Playwright's SIGINT handler exited the launcher before cleanup and before writing the packet. The launcher now owns SIGINT.
  • Compiled website tests. The website's unit tests now run through the same React Compiler configuration as the build (react-plugin.ts), so Petrinaut AI's tests run compiled too. react/memo-dependencies is enabled for Brunch's plugin only, through the website's oxlint overrides. Brunch's abortAutomaticTools is now stable, so the callbacks that call it stay stable too.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

  • Doesn't touch a publishable library. No changeset.

📜 Does this require a change to the docs?

  • The evaluation README and the persona README describe run packets and --max-messages.

🕸️ Does this require a change to the Turbo Graph?

  • Does not affect the execution graph. packet:run is a package script, not a Turbo task.

⚠️ Known issues

  • The probe keeps no server log, so its packets have no argument-streaming times.
  • The guidance variants are measured in local persona runs; their results are not part of this PR.

🛡 What tests cover this?

  • Unit tests for packet building and chronology-log parsing.
  • In-editor tests for two destructive calls in one step, under the compiled website tests.
  • Lint, type, unit, build and integration checks pass for @apps/brunch-agent, @apps/petrinaut-website, @hashintel/petrinaut and @hashintel/brunch-agent.

@lunelson
lunelson added this pull request to stack #10068 October 16, 2026 11:23
@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hash Ready Ready Preview Oct 23, 2026 9:16am UTC
petrinaut Ready Ready Preview Oct 23, 2026 9:16am UTC
petrinaut-docs Ready Ready Preview Oct 23, 2026 9:16am UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Preview Oct 23, 2026 9:16am UTC

Request Review

@github-actions github-actions Bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team area/apps labels Oct 16, 2026
@lunelson lunelson changed the title ln/fe 1943 shorten turn times FE-1943: Measure where Brunch persona runs spend their turn time Oct 16, 2026
@lunelson
lunelson deployed to pull-request October 16, 2026 11:24 — with GitHub Actions Active
@lunelson
lunelson deployed to pull-request October 16, 2026 11:24 — with GitHub Actions Active
@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (ln/fe-1960-brunch-plugin-chat@7862e25). Learn more about missing BASE report.

Additional details and impacted files
@@                       Coverage Diff                        @@
##             ln/fe-1960-brunch-plugin-chat   #10066   +/-   ##
================================================================
  Coverage                                 ?   68.08%           
================================================================
  Files                                    ?     2005           
  Lines                                    ?   206155           
  Branches                                 ?     8792           
================================================================
  Hits                                     ?   140364           
  Misses                                   ?    64117           
  Partials                                 ?     1674           
Flag Coverage Δ
apps.hash-ai-worker-ts 7.47% <ø> (?)
apps.hash-api 15.59% <ø> (?)
blockprotocol.type-system 40.85% <ø> (?)
durable-kernel 86.65% <ø> (?)
error-stack 90.55% <ø> (?)
harpc-codec 84.61% <ø> (?)
harpc-net 96.26% <ø> (?)
harpc-tower 67.11% <ø> (?)
harpc-types 0.00% <ø> (?)
harpc-wire-protocol 93.85% <ø> (?)
hash-codec 72.09% <ø> (?)
hash-config 83.57% <ø> (?)
hash-graph 21.07% <ø> (?)
hash-graph-api 39.82% <ø> (?)
hash-graph-atlas 80.01% <ø> (?)
hash-graph-authentication 96.71% <ø> (?)
hash-graph-authorization 68.47% <ø> (?)
hash-graph-embeddings 91.92% <ø> (?)
hash-graph-postgres-store 31.60% <ø> (?)
hash-graph-store 50.82% <ø> (?)
hash-graph-temporal-versioning 50.53% <ø> (?)
hash-graph-types 0.00% <ø> (?)
hash-graph-validation 85.37% <ø> (?)
hash-integrations-definition 95.05% <ø> (?)
hash-middleware 87.62% <ø> (?)
hash-secret 99.50% <ø> (?)
hashql-ast 90.01% <ø> (?)
hashql-compiletest 28.71% <ø> (?)
hashql-core 81.41% <ø> (?)
hashql-diagnostics 72.85% <ø> (?)
hashql-eval 81.55% <ø> (?)
hashql-hir 89.10% <ø> (?)
hashql-mir 87.22% <ø> (?)
hashql-syntax-jexpr 94.77% <ø> (?)
local.harpc-client 51.49% <ø> (?)
local.hash-backend-utils 6.21% <ø> (?)
local.hash-graph-sdk 9.79% <ø> (?)
local.hash-isomorphic-utils 32.37% <ø> (?)
problematic 90.09% <ø> (?)
railroad-plugin 45.28% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed

codspeed Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ Unable to measure the execution of 6 benchmarks

These benchmarks measured no execution time, so their results are not comparable and count as unchanged. This usually happens when the compiler removes the code under test.

Prevent compiler optimizations

See affected benchmarks

✅ 74 untouched benchmarks
⏩ 24 skipped benchmarks1


Comparing ln/fe-1943-shorten-turn-times (f2e4594) with main (91f7707)2

Open in CodSpeed

Footnotes

  1. 24 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on ln/fe-1960-brunch-plugin-chat (7862e25) during the generation of this report, so main (91f7707) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark results

hash-graph-benches – Integrations

policy_resolution_large

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2002 $$29.8 \mathrm{ms} \pm 270 \mathrm{μs}\left({\color{gray}2.46 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.76 \mathrm{ms} \pm 32.7 \mathrm{μs}\left({\color{gray}4.99 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1002 $$14.4 \mathrm{ms} \pm 147 \mathrm{μs}\left({\color{gray}0.506 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$47.4 \mathrm{ms} \pm 572 \mathrm{μs}\left({\color{gray}2.22 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$15.8 \mathrm{ms} \pm 185 \mathrm{μs}\left({\color{gray}4.67 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1527 $$27.0 \mathrm{ms} \pm 285 \mathrm{μs}\left({\color{gray}1.84 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$30.9 \mathrm{ms} \pm 317 \mathrm{μs}\left({\color{gray}0.759 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$4.05 \mathrm{ms} \pm 29.9 \mathrm{μs}\left({\color{gray}4.26 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$15.6 \mathrm{ms} \pm 182 \mathrm{μs}\left({\color{gray}3.24 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$4.10 \mathrm{ms} \pm 41.2 \mathrm{μs}\left({\color{gray}3.88 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.40 \mathrm{ms} \pm 31.1 \mathrm{μs}\left({\color{red}9.35 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 52 $$3.69 \mathrm{ms} \pm 30.3 \mathrm{μs}\left({\color{red}5.98 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.83 \mathrm{ms} \pm 49.2 \mathrm{μs}\left({\color{gray}4.67 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.99 \mathrm{ms} \pm 43.7 \mathrm{μs}\left({\color{red}5.73 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 108 $$4.68 \mathrm{ms} \pm 50.9 \mathrm{μs}\left({\color{gray}4.13 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$5.24 \mathrm{ms} \pm 56.9 \mathrm{μs}\left({\color{red}11.5 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.90 \mathrm{ms} \pm 38.8 \mathrm{μs}\left({\color{red}8.83 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.76 \mathrm{ms} \pm 44.5 \mathrm{μs}\left({\color{red}6.93 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$3.04 \mathrm{ms} \pm 27.1 \mathrm{μs}\left({\color{red}7.78 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.87 \mathrm{ms} \pm 24.4 \mathrm{μs}\left({\color{gray}4.49 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 2 $$3.08 \mathrm{ms} \pm 24.4 \mathrm{μs}\left({\color{red}7.43 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$3.22 \mathrm{ms} \pm 25.4 \mathrm{μs}\left({\color{gray}1.33 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.06 \mathrm{ms} \pm 32.0 \mathrm{μs}\left({\color{gray}3.82 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$3.44 \mathrm{ms} \pm 29.0 \mathrm{μs}\left({\color{red}5.87 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.28 \mathrm{ms} \pm 32.7 \mathrm{μs}\left({\color{gray}-0.551 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.91 \mathrm{ms} \pm 23.2 \mathrm{μs}\left({\color{gray}-0.106 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 26 $$3.13 \mathrm{ms} \pm 26.4 \mathrm{μs}\left({\color{gray}0.569 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.69 \mathrm{ms} \pm 39.5 \mathrm{μs}\left({\color{gray}-0.411 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.11 \mathrm{ms} \pm 23.2 \mathrm{μs}\left({\color{gray}-3.561 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 27 $$3.33 \mathrm{ms} \pm 23.6 \mathrm{μs}\left({\color{gray}-4.238 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.79 \mathrm{ms} \pm 39.5 \mathrm{μs}\left({\color{gray}4.36 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.23 \mathrm{ms} \pm 27.0 \mathrm{μs}\left({\color{gray}1.10 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.59 \mathrm{ms} \pm 28.9 \mathrm{μs}\left({\color{gray}-1.594 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$32.7 \mathrm{ms} \pm 231 \mathrm{μs}\left({\color{gray}-2.837 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$74.0 \mathrm{ms} \pm 810 \mathrm{μs}\left({\color{gray}-1.043 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$37.1 \mathrm{ms} \pm 290 \mathrm{μs}\left({\color{gray}-2.902 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$40.4 \mathrm{ms} \pm 249 \mathrm{μs}\left({\color{gray}-2.281 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$43.8 \mathrm{ms} \pm 358 \mathrm{μs}\left({\color{gray}-4.137 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$35.0 \mathrm{ms} \pm 290 \mathrm{μs}\left({\color{gray}-0.883 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$429 \mathrm{ms} \pm 2.43 \mathrm{ms}\left({\color{gray}-0.100 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$92.0 \mathrm{ms} \pm 696 \mathrm{μs}\left({\color{gray}1.09 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$81.6 \mathrm{ms} \pm 508 \mathrm{μs}\left({\color{gray}-0.486 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$291 \mathrm{ms} \pm 1.50 \mathrm{ms}\left({\color{lightgreen}-9.610 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$11.0 \mathrm{ms} \pm 81.0 \mathrm{μs}\left({\color{gray}-1.828 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$11.4 \mathrm{ms} \pm 92.4 \mathrm{μs}\left({\color{gray}-0.337 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$11.9 \mathrm{ms} \pm 95.3 \mathrm{μs}\left({\color{red}7.10 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$11.3 \mathrm{ms} \pm 97.6 \mathrm{μs}\left({\color{gray}-0.789 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$12.0 \mathrm{ms} \pm 105 \mathrm{μs}\left({\color{red}9.04 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$11.9 \mathrm{ms} \pm 108 \mathrm{μs}\left({\color{red}6.90 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$11.9 \mathrm{ms} \pm 108 \mathrm{μs}\left({\color{red}7.91 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$12.0 \mathrm{ms} \pm 127 \mathrm{μs}\left({\color{gray}4.47 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$12.2 \mathrm{ms} \pm 155 \mathrm{μs}\left({\color{red}7.02 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$13.3 \mathrm{ms} \pm 133 \mathrm{μs}\left({\color{red}16.3 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$11.9 \mathrm{ms} \pm 153 \mathrm{μs}\left({\color{gray}4.69 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$11.8 \mathrm{ms} \pm 166 \mathrm{μs}\left({\color{red}5.68 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$11.8 \mathrm{ms} \pm 112 \mathrm{μs}\left({\color{gray}2.61 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$11.6 \mathrm{ms} \pm 112 \mathrm{μs}\left({\color{gray}4.70 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$11.7 \mathrm{ms} \pm 107 \mathrm{μs}\left({\color{gray}3.02 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$11.7 \mathrm{ms} \pm 92.8 \mathrm{μs}\left({\color{gray}2.60 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$11.5 \mathrm{ms} \pm 92.3 \mathrm{μs}\left({\color{gray}-0.796 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$12.0 \mathrm{ms} \pm 92.6 \mathrm{μs}\left({\color{gray}2.84 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$11.9 \mathrm{ms} \pm 120 \mathrm{μs}\left({\color{gray}2.98 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity_type

Function Value Mean Flame graphs
get_entity_type_by_id Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba $$8.59 \mathrm{ms} \pm 63.6 \mathrm{μs}\left({\color{gray}2.38 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$62.7 \mathrm{ms} \pm 601 \mathrm{μs}\left({\color{red}5.32 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$116 \mathrm{ms} \pm 850 \mathrm{μs}\left({\color{gray}0.609 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$68.9 \mathrm{ms} \pm 637 \mathrm{μs}\left({\color{gray}4.25 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$78.7 \mathrm{ms} \pm 764 \mathrm{μs}\left({\color{gray}2.12 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$86.7 \mathrm{ms} \pm 799 \mathrm{μs}\left({\color{gray}-0.085 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$93.8 \mathrm{ms} \pm 830 \mathrm{μs}\left({\color{gray}1.19 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$49.6 \mathrm{ms} \pm 502 \mathrm{μs}\left({\color{gray}-1.584 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$78.8 \mathrm{ms} \pm 574 \mathrm{μs}\left({\color{gray}-1.733 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$56.0 \mathrm{ms} \pm 536 \mathrm{μs}\left({\color{gray}-0.808 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$66.5 \mathrm{ms} \pm 569 \mathrm{μs}\left({\color{gray}2.43 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$66.9 \mathrm{ms} \pm 576 \mathrm{μs}\left({\color{gray}-1.835 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$66.9 \mathrm{ms} \pm 449 \mathrm{μs}\left({\color{gray}-3.633 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$116 \mathrm{ms} \pm 753 \mathrm{μs}\left({\color{gray}2.78 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$128 \mathrm{ms} \pm 929 \mathrm{μs}\left({\color{gray}1.65 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$24.3 \mathrm{ms} \pm 224 \mathrm{μs}\left({\color{gray}0.968 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$536 \mathrm{ms} \pm 1.67 \mathrm{ms}\left({\color{gray}0.903 \mathrm{\%}}\right) $$ Flame Graph

@lunelson lunelson changed the title FE-1943: Measure where Brunch persona runs spend their turn time FE-1943: Shorten Brunch turn times, pass I Oct 16, 2026
@lunelson lunelson changed the title FE-1943: Shorten Brunch turn times, pass I FE-1943: Instrument Brunch persona runs for turn time Oct 16, 2026
@lunelson
lunelson force-pushed the ln/fe-1943-shorten-turn-times branch from 77ed9dc to 56e2982 Compare October 16, 2026 16:35
@lunelson
lunelson force-pushed the ln/fe-1943-shorten-turn-times branch from 56e2982 to 7ff6e18 Compare October 19, 2026 08:31
@lunelson lunelson changed the title FE-1943: Instrument Brunch persona runs for turn time FE-1943: Show where each Brunch exchange's time goes in persona runs Oct 19, 2026
@lunelson
lunelson force-pushed the ln/fe-1943-shorten-turn-times branch from 7ff6e18 to c88acb4 Compare October 19, 2026 13:45
@lunelson
lunelson force-pushed the ln/fe-1943-shorten-turn-times branch from 79cf0d7 to f2e4594 Compare October 22, 2026 15:36
@lunelson
lunelson requested a review from a team as a code owner October 22, 2026 15:36
@lunelson
lunelson changed the base branch from main to ln/fe-1960-brunch-plugin-chat October 22, 2026 15:36
@lunelson
lunelson added this pull request to stack #10173 October 22, 2026 15:37
@lunelson
lunelson deployed to pull-request October 22, 2026 15:38 — with GitHub Actions Active
@lunelson
lunelson deployed to pull-request October 22, 2026 15:38 — with GitHub Actions Active

@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 and found 1 potential issue.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit f2e4594. Configure here.

Comment thread apps/brunch-agent/evals/petrinaut/run-packet/build-run-packet.ts
@semgrep-code-hashintel

Copy link
Copy Markdown

Semgrep found 2 node_timing_attack findings:

  • apps/petrinaut-website/src/main/app/plugins/petrinaut-ai/chat/assistant-chat/chat-api.ts
  • apps/petrinaut-website/src/main/app/plugins/brunch/chat/ai-assistant-panel/editor-api.ts

🟡 Medium severity issue identified in your code:

String comparisons using '===', '!==', '!=' and '==' is vulnerable to timing attacks. A timing attack allows the attacker to learn potentially sensitive information by, for example, measuring how long it takes for the application to respond to a request. More info: https://nodejs.org/en/learn/getting-started/security-best-practices#information-exposure-through-timing-attacks-cwe-208

lunelson and others added 13 commits October 23, 2026 10:59
…abort stable

Turn the rule on only for `src/main/app/plugins/brunch/**`, through the
website's oxlint overrides. The shared React Compiler config, Petrinaut's
library and Petrinaut AI's chat are unchanged.
The run packet compared a step's first text, measured from the step's
request, with its first tool-argument delta, measured by the server
chronology from the later turn start. Tool deltas looked earlier than
they were, so hidden reasoning was understated on every step, and the
packet's tool-call delta fields did not count from where their docs said.

The chronology now logs each turn's start time, and the packet moves its
offsets onto the step's request before comparing them. Logs written
before this change cannot place their deltas, so the packet leaves them
out instead of mixing origins. Argument streaming time is unchanged.

The packet's user excerpt also unwraps a contextual user message, so a
turn sent with interview length or Words shows the person's words.
Comment thread apps/petrinaut-website/vite.config.ts

This branch was successfully deployed

4 active (1 outdated) deployments
Preview – hash — 45b1955b Deployed Oct 23, 2026 by vercel[bot]
Preview – petrinaut — 45b1955b Deployed Oct 23, 2026 by vercel[bot]
Preview – petrinaut-docs — 45b1955b Deployed Oct 23, 2026 by vercel[bot]
pull-request — f2e45948 Deployed Oct 22, 2026 by lunelson via Sourcemaps (@apps/hash-integration-worker) #41064
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps area/infra Relates to version control, CI, CD or IaC (area)

Development

Successfully merging this pull request may close these issues.

2 participants