fix(status): correct context percentage calculation and sync consolidator
- Pass resolved self.context_window_tokens to Consolidator instead of raw parameter that could be None, preventing consolidation failures - Calculate percentage against input budget (ctx - max_completion - 1024) instead of raw context window, consistent with Consolidator/snip formulas - Pass actual max_completion_tokens from provider to build_status_content - Cap percentage display at 999 to prevent runaway values - Add tests for budget-based percentage and cap behavior
This commit is contained in:
@@ -91,6 +91,9 @@ async def cmd_status(ctx: CommandContext) -> OutboundMessage:
|
||||
context_tokens_estimate=ctx_est,
|
||||
search_usage_text=search_usage_text,
|
||||
active_task_count=task_count,
|
||||
max_completion_tokens=getattr(
|
||||
getattr(loop.provider, "generation", None), "max_tokens", 8192
|
||||
),
|
||||
),
|
||||
metadata={**dict(ctx.msg.metadata or {}), "render_as": "text"},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user