mirror of
https://github.com/openai/codex.git
synced 2026-11-26 07:26:11 +00:00
Account subagent token usage toward root goals (#41183)
## What changed - Roll token usage from spawned descendants, including nested subagents, into the root goal's usage. - Apply descendant usage during active and idle progress accounting so it contributes to token budgets. - Reset descendant accounting baselines when the active goal changes and preserve usage recorded concurrently with a checkpoint. ## Testing - Cover child and grandchild usage, budget exhaustion, unloaded parent runtimes, goal replacement, idle accounting, and concurrent checkpoints. GitOrigin-RevId: 8f97ec6778c55b9adf94b887b5fd03999ed0eb94
This commit is contained in:
1 parent
5f49aba876
commit
4761851ff3
6 files changed
+398
-18
No files matched your search
@@ -345,7 +345,7 @@ impl GoalService {
|
||||
}
|
||||
}
|
||||
|
||||
fn runtime_for_thread(&self, thread_id: ThreadId) -> Option<Arc<GoalRuntimeHandle>> {
|
||||
pub(crate) fn runtime_for_thread(&self, thread_id: ThreadId) -> Option<Arc<GoalRuntimeHandle>> {
|
||||
let key = thread_id.to_string();
|
||||
let mut runtimes = self.runtimes();
|
||||
let runtime = runtimes.get(&key).and_then(Weak::upgrade);
|
||||
|
||||
Reference in new issue
Block a user