-
Notifications
You must be signed in to change notification settings - Fork 24
feat(orchestrator): self-deleting run cache + responsiveness analytics #677
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
gewenyu99
merged 5 commits into
experiment/orchestrator-01-bootstrap-gating
from
experiment/orchestrator-run-cache
Jun 18, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d870de1
feat(orchestrator): self-deleting run cache + responsiveness analytics
gewenyu99 b0c17a5
fix(orchestrator): pass transitive-ancestor handoffs, not just direct…
gewenyu99 bd37b8a
fix(tui): give the log tail two rows of headroom so it doesn't squish…
gewenyu99 1568dc2
fix(orchestrator): resolve the framework reference to its integration…
gewenyu99 31b0080
feat(orchestrator): confine task agents to the project directory
gewenyu99 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
68 changes: 68 additions & 0 deletions
68
src/lib/programs/orchestrator/__tests__/run-metrics.test.ts
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,68 @@ | ||
| import { RunMetrics } from '@lib/programs/orchestrator/run-metrics'; | ||
|
|
||
| describe('RunMetrics', () => { | ||
| it('reports time to first start and first completion from run start', () => { | ||
| const m = new RunMetrics(0); | ||
| m.recordStart(100); | ||
| m.recordComplete(300); | ||
| m.recordStart(1000); | ||
| m.recordComplete(1100); | ||
| const s = m.summary(); | ||
| expect(s.time_to_first_task_ms).toBe(100); | ||
| expect(s.time_to_first_completion_ms).toBe(300); | ||
| }); | ||
|
|
||
| it('max_gap_ms is the longest silence across all visible transitions', () => { | ||
| const m = new RunMetrics(0); | ||
| m.recordStart(100); // visible @100 | ||
| m.recordComplete(300); // gap 200 | ||
| m.recordStart(1000); // gap 700 ← longest | ||
| m.recordComplete(1100); // gap 100 | ||
| expect(m.summary().max_gap_ms).toBe(700); | ||
| }); | ||
|
|
||
| it('recordStart returns ms_since_run_start and the gap from the previous start', () => { | ||
| const m = new RunMetrics(0); | ||
| expect(m.recordStart(100)).toEqual({ | ||
| ms_since_run_start: 100, | ||
| gap_since_prev_start_ms: undefined, | ||
| }); | ||
| expect(m.recordStart(1000)).toEqual({ | ||
| ms_since_run_start: 1000, | ||
| gap_since_prev_start_ms: 900, | ||
| }); | ||
| }); | ||
|
|
||
| it('reports undefined timings for a run with no transitions, not zero', () => { | ||
| const s = new RunMetrics(0).summary(); | ||
| expect(s.time_to_first_task_ms).toBeUndefined(); | ||
| expect(s.time_to_first_completion_ms).toBeUndefined(); | ||
| expect(s.max_gap_ms).toBeUndefined(); | ||
| }); | ||
|
|
||
| it('a single started-but-unfinished task reports a real zero gap and no completion', () => { | ||
| const m = new RunMetrics(0); | ||
| m.recordStart(50); | ||
| const s = m.summary(); | ||
| expect(s.time_to_first_task_ms).toBe(50); | ||
| expect(s.time_to_first_completion_ms).toBeUndefined(); | ||
| expect(s.max_gap_ms).toBe(0); // one visible transition → genuine 0, not undefined | ||
| }); | ||
|
|
||
| it('counts a retry stall (start to re-start) as silence', () => { | ||
| const m = new RunMetrics(0); | ||
| m.recordStart(0); | ||
| // the task ended without reporting and was requeued (invisible), then | ||
| // re-started 5s later — that stall is a silence the user sees. | ||
| m.recordStart(5000); | ||
| expect(m.summary().max_gap_ms).toBe(5000); | ||
| }); | ||
|
|
||
| it('treats skip and fail as visible transitions for gap tracking', () => { | ||
| const m = new RunMetrics(0); | ||
| m.recordStart(0); | ||
| m.recordTerminal(2000); // skip or fail, gap 2000 | ||
| m.recordStart(2500); // gap 500 | ||
| expect(m.summary().max_gap_ms).toBe(2000); | ||
| }); | ||
| }); |
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
Oops, something went wrong.
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.