debug(graph): surface _maybe_write_thread_title failures#491
Merged
Conversation
The frontend debug PR (#486) confirmed refresh() runs and resolves with 50 threads on demo.threadplane.ai/embed — so the empty-looking sidenav is actually 50 rows all labeled "Untitled" because metadata.title is missing on every prod thread. The Python title write is failing silently. Suspected cause: examples/chat/python/src/graph.py:99 falls back to LANGGRAPH_API_URL='http://localhost:2024' when the env var is unset inside the LangGraph Platform runtime container — which it almost certainly is. The get_client() call points at a port that doesn't exist in the container, threads.update() throws, the bare `except Exception: return` swallows it. Replace the bare swallow with a print(..., flush=True) in both graphs so the next prod run surfaces the actual error in LangGraph Platform logs. Once we see the error we can fix the URL/auth. Same anti-pattern, same fix as PR #486 (frontend adapter). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 tasks
blove
added a commit
that referenced
this pull request
May 20, 2026
…res errors (#492) LangGraph Platform's stdout (where PR #491's print() lands) isn't reachable via the LangSmith Runs API. After firing a probe against prod (thread 019e475a-4add-79a3-95b1-348525d79b0e) we confirmed the title stays null AND no actionable error surfaces in any API we can query. Wrap the helper with @langsmith.traceable so it becomes a child run in the trace tree, and convert all early-returns to typed dict returns (skipped/wrote_title/error_type/error_message). The error branch now captures type, message, and the sdk_url that was used — all of which show up in the run's `outputs` field when queried via the LangSmith Runs API. Cleaner than stdout grep, gives us the proximate cause without needing platform log access. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace the bare
except Exception: returnin two graphs withprint(..., flush=True)so prod runtime logs surface the actual error when the title write fails.examples/chat/python/src/graph.py::_maybe_write_thread_title(the prod demo's graph)cockpit/chat/threads/python/src/graph.py::generate_title(sibling — same env var, same anti-pattern)Why
After #486 shipped frontend debug logs, I drove Chrome to
demo.threadplane.ai/embedand confirmed:So
refresh()works fine — the SDK returns 50 threads. The bug isn't on the frontend. All 50 threads havemetadata.titlemissing, so the sidenav renders 50 rows of "Untitled" — visually indistinguishable from "empty." That's the actual user-visible bug.Suspected root cause:
examples/chat/python/src/graph.py:99falls back toLANGGRAPH_API_URL='http://localhost:2024'when the env var is unset inside the LangGraph Platform runtime container.get_client()then targets a port that doesn't exist in the container,threads.update()throws, and the bareexceptswallows it on every run. This PR will let us see the actual exception so we know what to fix.Test plan
from src.graph import graph)[_maybe_write_thread_title] failedFollow-up (not this PR)
The real fix — likely either:
LANGGRAPH_API_URL)langgraph_sdk.RemoteGraph/ the runtime's internal-call mechanism instead of looping through HTTP🤖 Generated with Claude Code