Conversation
- run-level reuseAcrossRuns flag (default false, part of requestHash) - agent() consults prior succeeded nodes from other runs in the same workspace store when context (workspace/input/executor/fingerprints) and spec hash match; newest first, schema revalidated per candidate - reused results carry reusedFrom provenance (crossRun marker, original producer preserved) and consume no call budget - store.findCrossRunReuse joins steps x runs with json_extract filters - README documents the semantics and the honest boundary: reuse proves context identity and storage fidelity, not first-run correctness
hetaoBackend
requested changes
Sep 18, 2026
hetaoBackend
left a comment
Collaborator
There was a problem hiding this comment.
Request changes for exact current head 35223d3.
Blocking correctness/contract issues:
reuseAcrossRunsis implemented inengine.mjs:48,77, but is absent from the public MCP schemas insrc/tools.mjs:13-14(and the generateddist/main.mjs). Those schemas useadditionalProperties:false, so a normal MCP client cannot discover or reliably send the documented feature. Add the field and description toworkflow_startandworkflow_update, rebuild dist, and add a packaged MCP contract test that enables it through the public tool surface.- Cross-run reuse does not track upstream lineage.
engine.mjs:199-208andstore.mjs:52match only the downstream node request hash and a run-level context hash;dependsOnis only the upstream ID. I reproduced this on the exact head: run 1 executeda(prompt=old) -> b(prompt=same), run 2 executeda(prompt=new)and then reusedbfrom run 1, producinga=out:newwithb=out:sameandreusedFrom.crossRun=true. A changed/rerun upstream must invalidate downstream reuse, as the README promises. Persist/compare effective dependency lineage or upstream output/spec hashes, and add the R1/R2 regression test. - For MCode nodes without an explicit
spec.model, the effective default model/provider/config comes from the CLI environment, but the cache identity contains onlyexecutor: 'mcode'and the node spec. A changed MCode default model/config/CLI can therefore reuse an old result. Require an explicit model for cross-run MCode reuse or include a resolved model/config/CLI identity in the cache key and test that a default-model change misses. store.findCrossRunReuse()appliesLIMIT 20before filtering by context hash (store.mjs:52), so 20 newer same-node results from other contexts can hide an older valid candidate forever. Filter in SQL using a persisted/indexed context key or scan/paginate until a valid candidate is found.- Cross-run adoption of a repair-reused step preserves the old
reusedFromobject (engine.mjs:205-206) while emitting acrossRun:trueevent (:207), so stored provenance can disagree with the event. Preserve immediate source and original producer as separate provenance fields and add a repair-to-cross-run test.
Current GitHub checks are green, but they do not cover the public MCP schema path or the reproduced stale-lineage case. Rebase/rebuild against the current main before requesting another review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Implements opt-in content-addressed cross-run reuse for the dynamic-workflow plugin: a run can now adopt succeeded nodes from any prior run in the same workspace store when both the execution context and the call spec hash identically — not only within a repair lineage.
Design provenance: the derived-stable-identifier approach ("the key is the identity") follows our deterministic-addressing tool (sih-engine family,
sih-tools/locator).Design
reuseAcrossRuns: trueonstart/update(default false). The key is absent from the definition unless explicitly true — an always-present default key would changerequestHashand break the legacy idempotent-replay path (caught by the "legacy limits … old idempotent requests still work" test; the fix follows the same absent-means-default pattern asDEFAULT_LIMITS).hash({workspace, input, executor, fingerprints})(same four factors as repair's contextHash, cached per run), spec =hash(spec)(prompt/schema/input included — a different schema is a different contract). Lookup joinssteps × runsviajson_extract, newest first, this run excluded, onlysucceededagent nodes.reusedFrom— the original producer's lineage when present, otherwise{runId, stepId, endedAt, crossRun: true}— and emitstep.reused. Reuse consumes no call budget (attempt: 0, before the budget gate).Test evidence
checks/cross-reuse.check.mjs: 11 tests — default-off, opt-in hit (zero new calls, provenance, event), input/executor/prompt/schema/fingerprint changes all miss, failed nodes never reused, newest-wins, pure reuse on a one-call budget, requestId idempotency across a flipped flag.npm run buildbyte-reproducible; repository validator green on a clean checkout.main(00878c7).Follow-up seam
Once #48 (integrity ledger) merges, a small follow-up can route accepted cross-run reuses through the ledgered surface so "what reuse trusts" is covered by the same tamper-evidence chain.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.