langstage-cli 0.6.6__tar.gz → 0.6.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {langstage_cli-0.6.6/langstage_cli.egg-info → langstage_cli-0.6.7}/PKG-INFO +1 -1
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/langstage_cli/agui_stream.py +8 -3
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/langstage_cli/cli.py +11 -2
- {langstage_cli-0.6.6 → langstage_cli-0.6.7/langstage_cli.egg-info}/PKG-INFO +1 -1
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/langstage_cli.egg-info/SOURCES.txt +1 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/pyproject.toml +1 -1
- langstage_cli-0.6.7/tests/test_configurable.py +37 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/LICENSE +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/README.md +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/deepagent_code/__init__.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/langstage_cli/__init__.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/langstage_cli/config.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/langstage_cli.egg-info/dependency_links.txt +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/langstage_cli.egg-info/entry_points.txt +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/langstage_cli.egg-info/requires.txt +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/langstage_cli.egg-info/top_level.txt +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/setup.cfg +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_agui_stream.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_checkpointer.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_cli.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_cli_help.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_codeconfig.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_config.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_help_render.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_no_interactive_approve.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_quiet_output.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_rename_shim.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_show_config.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_spec_resolution.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_stream_mode.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_streaming_marker.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_turn_exit_and_render.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_unicode_console.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_verify_flag.py +0 -0
- {langstage_cli-0.6.6 → langstage_cli-0.6.7}/tests/test_workspace.py +0 -0
|
@@ -30,13 +30,18 @@ def ensure_agui_available() -> None:
|
|
|
30
30
|
raise RuntimeError(_IMPORT_HINT) from e
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
def build_session_agent(graph: Any, *, name: str = "langstage-cli") -> Any:
|
|
33
|
+
def build_session_agent(graph: Any, *, name: str = "langstage-cli", config: Any = None) -> Any:
|
|
34
34
|
"""Wrap a compiled graph once per session (checkpointer attached by the core
|
|
35
|
-
bridge), so multi-turn memory persists across turns.
|
|
35
|
+
bridge), so multi-turn memory persists across turns.
|
|
36
|
+
|
|
37
|
+
``config`` (a ``RunnableConfig``, e.g. ``{"configurable": {...}}`` seeded from
|
|
38
|
+
``langstage.toml``'s ``[configurable]`` table) is forwarded to the graph on
|
|
39
|
+
every turn, so keys beyond ``thread_id`` actually reach the agent. (gh #57)
|
|
40
|
+
"""
|
|
36
41
|
ensure_agui_available()
|
|
37
42
|
from langstage_core.agui import build_agent
|
|
38
43
|
|
|
39
|
-
return build_agent(graph, name=name)
|
|
44
|
+
return build_agent(graph, name=name, config=config)
|
|
40
45
|
|
|
41
46
|
|
|
42
47
|
async def agui_stream_updates(
|
|
@@ -1328,12 +1328,21 @@ def run_conversation_loop(
|
|
|
1328
1328
|
# the core bridge) so multi-turn memory persists. Since langstage-core 1.0 the
|
|
1329
1329
|
# AG-UI adapter is the only streaming path.
|
|
1330
1330
|
thread_id = ""
|
|
1331
|
+
configurable: Dict[str, Any] = {}
|
|
1331
1332
|
if isinstance(config, dict):
|
|
1332
|
-
|
|
1333
|
+
configurable = dict(config.get("configurable", {}))
|
|
1334
|
+
thread_id = configurable.get("thread_id", "") or ""
|
|
1333
1335
|
from langstage_cli.agui_stream import build_session_agent
|
|
1334
1336
|
|
|
1337
|
+
# Forward the resolved `[configurable]` table (minus thread_id, which the
|
|
1338
|
+
# adapter sets per-run) to the graph, so keys beyond thread_id — the documented
|
|
1339
|
+
# way to parameterize an agent — actually reach it instead of being silently
|
|
1340
|
+
# dropped while /config advertises them. (gh #57)
|
|
1341
|
+
configurable.pop("thread_id", None)
|
|
1342
|
+
session_config = {"configurable": configurable} if configurable else None
|
|
1343
|
+
|
|
1335
1344
|
try:
|
|
1336
|
-
agui_agent = build_session_agent(graph, name=agent_name)
|
|
1345
|
+
agui_agent = build_session_agent(graph, name=agent_name, config=session_config)
|
|
1337
1346
|
except RuntimeError as e:
|
|
1338
1347
|
_status(f"{RED}⏺ {e}{RESET}")
|
|
1339
1348
|
return
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "langstage-cli"
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.7"
|
|
8
8
|
description = "The terminal stage for your LangGraph agent — Claude Code-style CLI for any CompiledGraph"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""The langstage.toml [configurable] table reaches the graph (gh #57).
|
|
2
|
+
|
|
3
|
+
`/config` and `--show-config` advertise that `[configurable]` seeds LangGraph's
|
|
4
|
+
`RunnableConfig.configurable`, but the AG-UI streaming path used to forward only
|
|
5
|
+
`thread_id` — every other key was silently dropped. The session agent now carries
|
|
6
|
+
the resolved configurable, so a node's `config["configurable"]` sees it.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from click.testing import CliRunner
|
|
10
|
+
|
|
11
|
+
from langstage_cli.cli import main
|
|
12
|
+
|
|
13
|
+
_CFG_AGENT = (
|
|
14
|
+
"from langgraph.graph import StateGraph, START, END\n"
|
|
15
|
+
"from langgraph.graph.message import MessagesState\n"
|
|
16
|
+
"from langchain_core.messages import AIMessage\n"
|
|
17
|
+
"def respond(state, config):\n"
|
|
18
|
+
" c = (config or {}).get('configurable', {})\n"
|
|
19
|
+
" return {'messages': [AIMessage(content='custom_key=' + str(c.get('custom_key')))]}\n"
|
|
20
|
+
"g = StateGraph(MessagesState)\n"
|
|
21
|
+
"g.add_node('respond', respond)\n"
|
|
22
|
+
"g.add_edge(START, 'respond')\n"
|
|
23
|
+
"g.add_edge('respond', END)\n"
|
|
24
|
+
"graph = g.compile()\n"
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def test_configurable_toml_reaches_the_graph(tmp_path, monkeypatch):
|
|
29
|
+
monkeypatch.chdir(tmp_path)
|
|
30
|
+
(tmp_path / "langstage.toml").write_text('[configurable]\ncustom_key = "from-toml"\n')
|
|
31
|
+
agent = tmp_path / "cfg_agent.py"
|
|
32
|
+
agent.write_text(_CFG_AGENT)
|
|
33
|
+
|
|
34
|
+
r = CliRunner().invoke(main, ["-a", f"{agent}:graph", "hi"])
|
|
35
|
+
assert r.exit_code == 0, r.output
|
|
36
|
+
# The node saw the [configurable] value, not None.
|
|
37
|
+
assert "custom_key=from-toml" in r.output, r.output
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|