feat(claude-do): Expose HandoffRoundTracker budget via an MCP tool (e.g. get_
The handoff-budget task (round/remaining/final now surfaced in the handoff.md brief via HandoffRoundTracker.GetStatus, wired through InteractiveLaunchSpecService.BuildForMergeHelperHandoffAsync) only reaches the session at the start of a handoff round. There is no way to query the current round/remaining budget for a handler task mid-session or from outside (e.g. the UI, or a script). Consider add ClaudeDo-Task: 0a185f8e-823d-42fc-9a5b-97c5eb91c616
This commit is contained in:
@@ -26,6 +26,20 @@ public sealed class HandoffRoundTracker
|
||||
|
||||
public sealed record Result(bool Rejected, bool Coerced, string EffectivePhase, string? Error);
|
||||
|
||||
// Read-only budget lookup for a handler task that hasn't (yet) called HandoffListHandler --
|
||||
// Round/Remaining/Final all report their untouched defaults instead of throwing, since "no
|
||||
// handoff yet" is a normal state, not an error.
|
||||
public sealed record Status(int Round, int Remaining, bool Final);
|
||||
|
||||
public Status GetStatus(string taskId)
|
||||
{
|
||||
if (!_states.TryGetValue(taskId, out var state))
|
||||
return new Status(0, MaxHandoffs, false);
|
||||
|
||||
lock (state)
|
||||
return new Status(state.Count, Math.Max(0, MaxHandoffs - state.Count), state.Sealed);
|
||||
}
|
||||
|
||||
public Result Register(string taskId, string nextPhase)
|
||||
{
|
||||
var state = _states.GetOrAdd(taskId, _ => new TaskState());
|
||||
|
||||
Reference in New Issue
Block a user