Repository navigation
Bounded run reads: paged run list, run summaries, path reads, retention - #59
Merged
Merged
Conversation
Every run is one JSON file in the state directory and none was ever deleted,
so the run list grows with every trigger that fires, and one record carries
each node's output more than once (state, completedNodes, trace). Returned
whole, either can overflow what an agent reads in one tool result; hosts cut
larger results and keep only the start.
- core/runs.ts, exported for other hosts like manage.ts:
- listRuns: newest first, a page at a time, on a (createdAt, instanceId)
cursor so runs that start while a caller pages never shift a page and
runs created in the same millisecond are neither skipped nor repeated.
Loop/branch instance files are skipped by name, before parsing.
- summarizeRun / runView: the run whole when it fits, else its status,
error, each state key with its size, and the trace without outputs.
- readRunValue: one value by dot path. Arrays are paged by item and a page
shrinks until it fits, strings are paged by character, and an object too
big to return comes back as its outline with paths to pass back.
- pruneRuns: deletes finished runs (completed, failed, cancelled) with their
sub-flow files after the retention period. Running, paused and waiting
runs are never deleted; resume reads their record.
- flow_status lists runs a page at a time (limit, cursor, flow, filter) and
reads one value of a run with path/offset/limit. flow_run and flow_resume
return the summary once a run passes 16,000 characters.
- Retention runs daily in the serving process, first a minute after start.
runRetentionDays in the plugin config, default 30; 0 keeps every run.
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.
Every run is one JSON file in the state directory and none was ever deleted,
so the run list grows with every trigger that fires, and one record carries
each node's output more than once (state, completedNodes, trace). Returned
whole, either can overflow what an agent reads in one tool result; hosts cut
larger results and keep only the start.
cursor so runs that start while a caller pages never shift a page and
runs created in the same millisecond are neither skipped nor repeated.
Loop/branch instance files are skipped by name, before parsing.
error, each state key with its size, and the trace without outputs.
shrinks until it fits, strings are paged by character, and an object too
big to return comes back as its outline with paths to pass back.
sub-flow files after the retention period. Running, paused and waiting
runs are never deleted; resume reads their record.
reads one value of a run with path/offset/limit. flow_run and flow_resume
return the summary once a run passes 16,000 characters.
runRetentionDays in the plugin config, default 30; 0 keeps every run.