Repository navigation
Conversation
nc-review: needs work — 2 blocking, 4 important@rishu685 — there is a blocking item below. The PR introduces a new 🔴 blocking · No module in 🔴 blocking ·
🟠 important ·
🟠 important · The tests cover 🟠 important · The diff references issue #1585 in the title only ('(#1585)') and uses the word 'Addresses' rather than 'Closes', but the context confirms the PR is not linked as a closing PR. CONTRIBUTING says substantial changes should be drafted and discussed in an issue before implementation. This PR adds five new files and four new exported types with no integration code, no spec, and a description that misrepresents what the compiler output is. A maintainer cannot tell from the diff alone what problem this solves end-to-end. The right next step is to file (or finish) the spec on issue #1585 describing how macros fit alongside the existing custom-tools/custom-commands/skills primitives, then split this PR into the building blocks once there is agreement on the design. 🟠 important · The PR is framed as a single feature ('compile repeated agent workflows') but lands three independent subsystems — sliding-window pattern detection, a sequential tool orchestrator, and a tool-format exporter — without any of them being wired into the agent loop. Even if the project wants all three, they should land in separate, reviewable commits (or separate PRs) so each can be discussed on its own merits. As-is, a reviewer cannot accept the runner without accepting the tracker, or vice versa, which is exactly the coupling CONTRIBUTING's 'discuss substantial changes first' guidance is asking contributors to avoid. 🔴 blocking · 🟠 a reviewer would ask for a change · ⚪ optional Automated code review — correctness, security, design, tests, plus duplicates and scope. A human still decides; this is not a substitute for review and is not exhaustive. The required status checks separately cover lint, formatting, types, unused dependencies, the test suite and the build. This bot never merges. Maintainers can rerun with |
|
I have updated this PR to consolidate all components into a complete, unified implementation! Summary of What is Included in this PR
|
addyCooks
left a comment
There was a problem hiding this comment.
Thanks @rishu685, the code is tidy and the checks pass,
but I can't review it for merge yet. I ran it:
- Nothing calls
recordExecutionorexecuteMacrooutside the specs (sequence-tracker.tsL25,macro-runner.tsL62), so/macrosis always empty in a real session and compile can't be reached. /macros compilebuilds a dummy sequence with empty args (macros.tsxL121-128), so a compiled macro would have no real parameters.- The exported markdown (
macro-compiler.tsL70-97) parses as a custom tool, but withapproval: alwaysand a body that is only a JSON dump handed to the shell. It doesn't run the macro steps. macros.tsxL140-141 silently overwrites an existing tool file with the same name.
Since #1585 is a proposal and no design is agreed yet,
Happy to review once it's settled.
0b8b169 to
852c278
Compare
addyCooks
left a comment
There was a problem hiding this comment.
Thanks @rishu685, #1619 now matches the PR 1 scope we agreed.
I checked the head commit: the specs pass (44/44), types, lint, knip and Semgrep are clean, breakChain() is wired for mutations, failures and agent batches, the pass count is gone, parallel batches are tagged, and the coverage note is in the description.
Before this can merge:
- Counts are inflated (
sequence-tracker.tsL55-86): one run of fourread_filecalls reportsread_file -> read_file — 3 times, because each suffix counts as a repeat. Please count non-overlapping repeats so a single run isn't reported as repeated. /macroslists non-repeated pairs: it usesgetPatterns(1), while the empty-state text says "repeated". Please listgetCandidates()(2 or more).- PR body: "Resolves #1585" will close the issue when Part 1 merges. Please change it to "Part of #1585".
acp-agent.ts: the encoding fixes are unrelated to this issue; please move them to a separate PR or drop them here.
Optional: output is stored per record but nothing reads it yet,
so it could wait for PR 2, and the tracker could reset on /clear.
852c278 to
df95b90
Compare
|
Hi @addyCooks! Thank you for catching those items! I've addressed all points in the latest push:
All 47 tests ( |
Part of #1585 (Part 1 of 2)
Summary
Per review feedback from @addyCooks, this PR implements PR 1: Runtime Read-Only Sequence Tracker & Listing.
Execution mechanisms (
runner: macrocustom tool), compiler logic, parameter binding across steps, and/macros compileare deferred to PR 2.Key Changes in PR 1
Read-Only Sequence Tracker (
source/macros/sequence-tracker.ts):startIndex > lastEndand tracks streaks so identical tool runs (e.g. fourread_filecalls in a row) only count once per run (occurrences = 1) and do not inflate candidate counts.exemplarRecordsonWorkflowPatternwith real argument values for PR 2's parameterization.Explicit Chain Break Semantics (
breakChain()):tracker.breakChain()resets contiguous tracking on non-read-only tool calls, failed executions (isToolResultError), and agent subagent batches (executeAgentBatch).Parallel Batch Tagging (
parallelBatch: true):Promise.allbatches are tagged withparallelBatch: trueso PR 2's compiler knows they are concurrent siblings rather than sequential dependencies.Interactive
/macrosCommand (source/commands/macros.tsx):/macros: Displays candidate workflows (getCandidates(), occurrences/macros clear&/clear: Resets active tracking history and discovered patterns.Coverage Scope:
source/hooks/chat-handler/conversation/tool-executor.tsx). Non-interactive paths (ACPand--plain) callprocessToolUsedirectly and are excluded in v1.Upcoming in PR 2
runner: macro)./macros compilecommand.Testing & Verification
sequence-tracker.spec.ts,macros.spec.tsx,tool-executor.spec.ts,clear.spec.tsx.