Conversation
Add hacb task start/status/stop managing durable named tasks with their own request, prompt-char, and tool-loop limits. The bridge reserves from the active task after the daily reservation succeeds; exhaustion releases the unused daily slot and fails closed with an explicit operator message. No active task means no per-task enforcement; daily caps always remain authoritative. Defaults: 8 requests, 180k prompt chars, warn at 120k chars.
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 changed
Daily caps bound a whole day; runaway agent loops happen per task. Adds durable named tasks with their own budgets:
hacb task start <name>/hacb task status/hacb task stop(src/cli.mjs)/tasks.jsonbehind the existing file-lock pattern (src/config.mjs):startTask,getActiveTask,stopTask,reserveTaskRequest,commitTaskToolLoopConfig:
maxRequestsPerTask(8),maxPromptCharsPerTask(180000),warnAtPromptCharsPerTask(120000 → audittask_budget_warning).Guarantees (test-enforced):
Testing
npm test: 81 pass, 0 fail (3 pre-existing skips). New files: test/task-budget.test.mjs; bridge-level 200→429 flow asserts the daily slot was released.