Skip to content

Commit 4f6a797

Browse files
committed
fix(demo): pin coordinode SDK in 03 notebook Colab branch, surface unhealthy-port fallback
- Add _SDK_PIP_SPEC alongside _EMBEDDED_PIP_SPEC; use the pinned spec in the Colab branch so the SDK and embedded package resolve to the same git commit. Outside Colab the unpinned "coordinode" still comes from PyPI (editable installs / released wheels). - Port-probe fallback path now prints an explicit WARNING before switching to LocalClient(":memory:") — previously the silent close() could surprise a user who expected the local server to be used.
1 parent 4175e96 commit 4f6a797

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

demo/notebooks/03_langgraph_agent.ipynb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
" \"git+https://github.com/structured-world/coordinode-python.git\"\n",
4646
" \"@c2ce32064dd7f6495f0998049c0cc2f6f7a5767d#subdirectory=coordinode-embedded\"\n",
4747
")\n",
48+
"_SDK_PIP_SPEC = (\n",
49+
" \"git+https://github.com/structured-world/coordinode-python.git\"\n",
50+
" \"@c2ce32064dd7f6495f0998049c0cc2f6f7a5767d#subdirectory=coordinode\"\n",
51+
")\n",
4852
"\n",
4953
"# Install coordinode-embedded in Colab only (requires Rust build).\n",
5054
"if IN_COLAB and not os.environ.get(\"COORDINODE_ADDR\"):\n",
@@ -95,14 +99,15 @@
9599
" timeout=600,\n",
96100
" )\n",
97101
"\n",
102+
"_coordinode_spec = _SDK_PIP_SPEC if IN_COLAB else \"coordinode\"\n",
98103
"subprocess.run(\n",
99104
" [\n",
100105
" sys.executable,\n",
101106
" \"-m\",\n",
102107
" \"pip\",\n",
103108
" \"install\",\n",
104109
" \"-q\",\n",
105-
" \"coordinode\",\n",
110+
" _coordinode_spec,\n",
106111
" \"langchain-community\",\n",
107112
" \"langchain-openai\",\n",
108113
" \"langgraph\",\n",
@@ -175,7 +180,8 @@
175180
" print(f\"Connected to {COORDINODE_ADDR}\")\n",
176181
" _use_embedded = False\n",
177182
" else:\n",
178-
" # Port is open but not a CoordiNode server \u2014 fall through to embedded.\n",
183+
" # Port is open but server is unhealthy \u2014 surface clearly before falling back.\n",
184+
" print(f\"WARNING: port {grpc_port} is open but health check failed \u2014 falling back to embedded LocalClient(':memory:'). Data will be in-process only.\")\n",
179185
" client.close()\n",
180186
"\n",
181187
"if _use_embedded:\n",

0 commit comments

Comments
 (0)