test Feature/advanced observability#1
Conversation
… Pylance FALSE-positives, and rewrite comprehensive README for V3 enterprise features
… Pylance FALSE-positives, and rewrite comprehensive README for V3 enterprise features
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a401c9bf75
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| data = await request.json() | ||
| input_data: Any = data.get("input", None) | ||
| session_id: Optional[str] = data.get("session_id", None) | ||
| initial_state: Optional[dict] = data.get("state", {}) |
There was a problem hiding this comment.
Preserve stored session state when API callers omit
state
graph.arun() treats any non-None initial_state as authoritative, so defaulting this field to {} bypasses MemoryStore.get_state(session_id) entirely. In /invoke and /stream, a client that resumes an existing session_id without sending an explicit state will therefore start from an empty state on every request, losing the checkpoint/session-memory behavior this API is supposed to expose.
Useful? React with 👍 / 👎.
| state_key: If provided, the sub-graph will operate only on | ||
| state[state_key] instead of the entire parent state. | ||
| """ | ||
| async def sub_graph_node(input_data: Any, state: dict) -> Any: |
There was a problem hiding this comment.
Execute composed subgraphs in
run() instead of returning coroutines
as_node() always wraps the subgraph in async def, but the synchronous executor calls Node.execute(), which does not await coroutine functions. As a result, any parent graph using subgraph.as_node() and then calling run() returns a raw coroutine object (and emits an un-awaited coroutine warning) instead of executing the subgraph.
Useful? React with 👍 / 👎.
| sub_state = state.get(state_key, {}) if state_key else state | ||
| result = await self.arun(input_data, initial_state=sub_state) |
There was a problem hiding this comment.
Avoid nesting a
GraphState inside another GraphState
When state_key is omitted, sub_state is the parent GraphState object rather than a plain dict, and self.arun(..., initial_state=sub_state) wraps that object in a second GraphState. The nested executor later records state.to_dict(), which calls .copy() on the inner object and raises 'GraphState' object has no attribute 'copy', so await parent.arun(...) fails for the default full-state composition path.
Useful? React with 👍 / 👎.
| cls._sessions = {} | ||
| cls._db_path = None | ||
| cls._redis_client = None |
There was a problem hiding this comment.
Clear persisted backends inside
MemoryStore.reset()
The new docstring promises a full reset for tests, but this method only nulls the in-process attributes. If a test or service uses SQLite/Redis, calls reset(), and then reconfigures the same backend, get_state() still returns the old persisted rows/keys because nothing was actually deleted, so state leaks across runs despite the advertised reset semantics.
Useful? React with 👍 / 👎.
No description provided.