-
Notifications
You must be signed in to change notification settings - Fork 96
feat(workflows): set heartbeat cadence explicitly on every builtin workflow #2383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import assert from "node:assert/strict"; | ||
| import { describe, test } from "vitest"; | ||
| import adversarialVerification from "../../packages/workflows/builtin/adversarial-verification.js"; | ||
| import classifyAndAct from "../../packages/workflows/builtin/classify-and-act.js"; | ||
| import fanOutAndSynthesize from "../../packages/workflows/builtin/fan-out-and-synthesize.js"; | ||
| import generateAndFilter from "../../packages/workflows/builtin/generate-and-filter.js"; | ||
| import goal from "../../packages/workflows/builtin/goal.js"; | ||
| import loopUntilDone from "../../packages/workflows/builtin/loop-until-done.js"; | ||
| import openClaudeDesign from "../../packages/workflows/builtin/open-claude-design.js"; | ||
| import ralph from "../../packages/workflows/builtin/ralph.js"; | ||
| import tournament from "../../packages/workflows/builtin/tournament.js"; | ||
| import { DEFAULT_WORKFLOW_HEARTBEAT_INTERVAL_MINUTES } from "../../packages/workflows/src/shared/workflow-heartbeat-contract.js"; | ||
|
|
||
| /** | ||
| * Every builtin states its heartbeat cadence rather than inheriting it, so a | ||
| * change to the global default cannot silently re-cadence a long autonomous run | ||
| * or start heartbeating a workflow that deliberately runs quiet. | ||
| */ | ||
| describe("builtin workflow heartbeat cadences", () => { | ||
| const autonomous = [ | ||
| ["adversarial-verification", adversarialVerification], | ||
| ["classify-and-act", classifyAndAct], | ||
| ["fan-out-and-synthesize", fanOutAndSynthesize], | ||
| ["generate-and-filter", generateAndFilter], | ||
| ["goal", goal], | ||
| ["loop-until-done", loopUntilDone], | ||
| ["ralph", ralph], | ||
| ["tournament", tournament], | ||
| ] as const; | ||
|
|
||
| for (const [name, definition] of autonomous) { | ||
| test(`${name} heartbeats on the 15-minute default`, () => { | ||
| assert.equal(definition.heartbeatIntervalMinutes, 15); | ||
| assert.equal(definition.heartbeatIntervalMinutes, DEFAULT_WORKFLOW_HEARTBEAT_INTERVAL_MINUTES); | ||
| }); | ||
| } | ||
|
|
||
| test("open-claude-design disables heartbeats", () => { | ||
| // The user reviews generated HTML turn by turn, so the parent chat is | ||
| // already holding this workflow to its goal; a periodic alignment steer | ||
| // would interrupt that review rather than inform it. | ||
| assert.equal(openClaudeDesign.heartbeatIntervalMinutes, 0); | ||
| }); | ||
|
|
||
| test("every builtin states a cadence explicitly", () => { | ||
| for (const [name, definition] of [...autonomous, ["open-claude-design", openClaudeDesign] as const]) { | ||
| assert.equal(typeof definition.heartbeatIntervalMinutes, "number", `${name} must carry a resolved cadence`); | ||
| assert.ok( | ||
| Number.isFinite(definition.heartbeatIntervalMinutes) && definition.heartbeatIntervalMinutes >= 0, | ||
| `${name} must carry a non-negative finite cadence`, | ||
| ); | ||
| } | ||
| }); | ||
| }); | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.