Skip to content

Comments

fix[bug](graph): add execution_id to base Runtime and restore ctx.execution_id in escalation handler#5194

Merged
TimothyZhang7 merged 1 commit intoaden-hive:mainfrom
Antiarin:fix/escalate-to-coder-execution-id
Feb 21, 2026
Merged

fix[bug](graph): add execution_id to base Runtime and restore ctx.execution_id in escalation handler#5194
TimothyZhang7 merged 1 commit intoaden-hive:mainfrom
Antiarin:fix/escalate-to-coder-execution-id

Conversation

@Antiarin
Copy link
Contributor

@Antiarin Antiarin commented Feb 21, 2026

Description

Fixes two problems with escalate_to_coder:

  1. NodeContext had no execution_id field, so ctx.execution_id raised AttributeError and crashed the agent
  2. Commit 76d4d0d worked around the crash by swapping ctx.execution_id to stream_id, but stream_id is actually ctx.node_id (line 232 of event_loop_node.py), so the escalation event was carrying a node name like "intake" instead of the real execution ID like "exec_abc123".
    No downstream code reads this value today so it wasn't visibly broken, but it's incorrect data sitting in the AgentEvent.

This PR adds execution_id as a proper field on NodeContext, wires it through from the runtime, and restores the original ctx.execution_id in the escalation handler.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Related Issues

Fixes #5180

Changes Made

  • Added execution_id: str = "" field to NodeContext dataclass (node.py)
  • Added execution_id property to StreamRuntimeAdapter to expose the private _execution_id (stream_runtime.py)
  • Added execution_id property to base Runtime returning "" so both runtime types share the same interface (core.py)
  • Wired self.runtime.execution_id through GraphExecutor._build_context into NodeContext (executor.py)
  • Restored execution_id=ctx.execution_id in the escalate_to_coder handler, replacing the stream_id workaround (event_loop_node.py)
  • Added execution_id to DummyRuntime in test_graph_executor.py to match the contract
  • Added 5 tests covering the execution_id plumbing

Testing

  • Unit tests pass (708 passed, 0 failed)
  • Lint passes (cd core && ruff check .)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@Antiarin Antiarin force-pushed the fix/escalate-to-coder-execution-id branch from 9829135 to 571838a Compare February 21, 2026 10:50
@Antiarin Antiarin changed the title fix[bug](graph): add execution_id to NodeContext for escalate_to_coder fix[bug](graph): add execution_id to base Runtime and restore ctx.execution_id in escalation handler Feb 21, 2026
@TimothyZhang7 TimothyZhang7 merged commit 8c750c7 into aden-hive:main Feb 21, 2026
9 checks passed
@Antiarin Antiarin deleted the fix/escalate-to-coder-execution-id branch February 21, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Critical]: escalate_to_coder crashes: NodeContext has no attribute 'execution_id'

2 participants