| Name | Type | Description |
|---|---|---|
thread_id* | str | The app session thread identifier. Set both on
|
assistant_id* | str | None | The dcode agent identifier, if any. When set, it is
surfaced in trace metadata under |
sandbox_type | str | None | Default: NoneSandbox provider name for trace metadata, or |
turn_id | str | None | Default: None |
turn_number | int | None | Default: None |
Build the LangGraph stream config dict.
Stamps the shared coding-agent-v1 trace-metadata contract (LSEN-277) via
build_coding_agent_metadata — identity block, plugin/runtime versions,
turn markers, and repo/git/cwd attribution — onto metadata. Metadata set
here propagates trace-wide to every run in the graph (root, llm, tool, and
subagent subgraphs), which is exactly what the contract's "always" and
"where-known" keys require, so the helper output is stamped once here.
Scope-restricted contract keys are deliberately not emitted. approval_policy
(root/interrupted only) and ls_subagent_id / ls_subagent_type (subagent
only) cannot live in this trace-wide metadata: LangGraph propagates each key
to all descendant runs (per-key config merge, langgraph#7926 /
deepagents#3634), so they would leak onto run types outside their contract
appliesTo set and fail validation. This runtime exposes no clean
per-run-type metadata seam to scope them, so they are omitted by design
rather than leaked. (Subagent runs still inherit the parent/root thread_id
and all required keys, satisfying the contract's grouping rule.)
Also injects the dcode version into metadata["lc_versions"] so LangSmith
traces can be correlated with specific releases. create_deep_agent supplies
the SDK version through the compiled graph config, and LangChain merges
nested metadata dictionaries so both versions survive at stream time.
Also records dcode_client_deepagents_version as a dcode-client diagnostic.
This describes the Deep Agents package installed alongside the TUI, which
can differ from a remote graph's Deep Agents runtime version.
Stable per-turn id for the current user prompt, or None.
1-based per-thread turn index, or None.