Repository navigation
Conversation
…e it `rig queue list` and `rig queue show` loaded @openrig/daemon/conversation-key at start-up. That module is the openrig plugin's hook bridge script, about 60 KB of CommonJS that Node reads for its named exports at every load, and it has grown since the queue reads were last made fast. Only `rig queue create` (recording a conversation's key with --return-route auto) and the two handoff verbs (dropping a given key) use it, so they now load it when they run. The queue command's start-up test now refuses that module at start-up, as it already refuses zod.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
openrig-review
left a comment
There was a problem hiding this comment.
Approving the reviewed head c2bb161 to start the macOS package tests. rig queue list and rig queue show no longer load the conversation key, the openrig plugin's hook bridge script, at start-up. Only rig queue create and the two handoff verbs load it, when they run. The queue command's start-up test now fails if that module loads with the command, as it already does for zod.
The problem
Everyday
rig queue listandrig queue showbecame slower than in 0.7.26, by about 5% of a read's time on the reads measured. The cost is in the CLI process, not the daemon.For one
queue list --json, the CLI onmainopens four more modules than 0.7.26's. One module it already loaded also grew:@openrig/daemon/conversation-key: this re-exports from the openrig plugin's hook bridge script,assets/claude-hook-bridge.cjs.issued-conversation-address.rig queue listandrig queue shownever use it. Onlyrig queue createuses it, to record a conversation's key with--return-route auto, and the two handoff verbs use it to drop a given key. It was imported at the top ofcommands/queue.ts, so every queue command paid for it.What changes
commands/queue.tsloads the conversation key with a dynamicimport()inside the three actions that use it.withoutConversationKeystakes the prefix as an argument, so the constant is still defined in one place.rig queuemust not load it.How it was checked
Red first: at
main, the start-up test fails with "the conversation key was loaded with the queue command module". With the change, it passes.Tests: every CLI
queue*test file, plus the MCP queue, lazy program, bin wrapper and daemon start tests: 32 files, 820 passed, 1 skipped.npm run lintpassed.Measurement. Three CLIs were installed side by side in one home against one daemon, on a shared 4-core Linux box (load 2.3-2.8), with Node 22.23.4:
mainas packed (M);mainwith this change (F).Each command ran 100 rounds per CLI, the order rotating each round, and every exit was 0. Medians, with child CPU time (user + sys) from
wait4first and wall time second:queue list --jsonqueue show <id> --full --jsonview show escalations --json--versionAn earlier run on the same box gave F−M of −39.9 / −19.9 ms for
queue listand −32.1 / −12.4 ms forqueue show. With this change,queue listandqueue showload fewer modules than 0.7.26 did, because 0.7.26 loaded the hook bridge for them too.Limits
daemon-lifecyclenow also imports@openrig/daemon/bind-plan, which brings the bearer-token middleware. Every read command loads that (three files, about 13 KB). Its cost didn't show above noise onview show.rig sendalso imports the conversation key at start-up (isIssuedConversationAddress, since fix(delivery): give issued conversations a queue reply hint #4141). It isn't a queue read and isn't changed here.🤖 Generated with Claude Code
Summary by CodeRabbit