Implemented the next missing parity slice around clearing session env vars on /clear.

Wires clear_session_env_vars() into LocalCodingAgent.clear_runtime_state so the
/clear slash command now drops session-scoped env vars alongside the rest of the
ephemeral runtime state, matching commands/clear/caches.ts:127.
This commit is contained in:
Abdelrahman Abdallah
2026-04-20 00:52:28 +02:00
parent 72e6fffb34
commit cfd3bb9ca7
3 changed files with 25 additions and 1 deletions
+3
View File
@@ -67,6 +67,7 @@ from .team_runtime import TeamRuntime
from .tokenizer_runtime import describe_token_counter
from .workflow_runtime import WorkflowRuntime
from .worktree_runtime import WorktreeRuntime
from .session_env_vars import clear_session_env_vars
from .session_store import (
StoredAgentSession,
load_agent_session,
@@ -249,6 +250,8 @@ class LocalCodingAgent:
self.resume_source_session_id = None
if self.plugin_runtime is not None:
self.plugin_runtime.restore_session_state({})
# Mirror commands/clear/caches.ts: drop session-scoped env vars on /clear.
clear_session_env_vars()
def build_prompt_context(self, scratchpad_directory: Path | None = None):
return build_prompt_context(