Isolate plan and task runtime per session

This commit is contained in:
wuyang6
2026-05-13 20:07:09 +08:00
parent f2989cd48b
commit 0eb57f3f42
8 changed files with 146 additions and 22 deletions
+8 -6
View File
@@ -258,12 +258,14 @@ def _get_user_context_cached(
lsp_runtime = LSPRuntime.from_workspace(Path(cwd), additional_working_directories)
if lsp_runtime.has_lsp_support():
context['lspRuntime'] = lsp_runtime.render_summary()
plan_runtime = PlanRuntime.from_workspace(Path(cwd))
if plan_runtime.steps:
context['planRuntime'] = plan_runtime.render_summary()
task_runtime = TaskRuntime.from_workspace(Path(cwd))
if task_runtime.tasks:
context['taskRuntime'] = task_runtime.render_summary()
if scratchpad_directory:
scratchpad_path = Path(scratchpad_directory)
plan_runtime = PlanRuntime.from_storage_path(scratchpad_path / 'plan_runtime.json')
if plan_runtime.steps:
context['planRuntime'] = plan_runtime.render_summary()
task_runtime = TaskRuntime.from_storage_path(scratchpad_path / 'task_runtime.json')
if task_runtime.tasks:
context['taskRuntime'] = task_runtime.render_summary()
team_runtime = TeamRuntime.from_workspace(Path(cwd), additional_working_directories)
if team_runtime.has_team_state():
context['teamRuntime'] = team_runtime.render_summary()