Skip to content

Conversation

@cbornet
Copy link
Collaborator

@cbornet cbornet commented Dec 31, 2025

No description provided.

@github-actions github-actions bot added langchain `langchain` package issues & PRs dependencies Pull requests that update a dependency file (e.g. `pyproject.toml` or `uv.lock`) infra PRs made that include chores, devops, repo meta changes labels Dec 31, 2025
# type narrowing not working appropriately w/ callable check, can fix later
return True, handle_errors(exception) # type: ignore[return-value,call-arg]
return False, ""
return True, handle_errors(exception)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type narrowing now works because handle_errors cannot be a type anymore at this stage.
Note that type is callable.

if not _HAS_RESOURCE: # pragma: no cover - defensive
return
pid = process.pid
if pid is None:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subprocess.Popen.pid is never None.
Is it OK ?

system_prompt: str | SystemMessage | None = None,
middleware: Sequence[AgentMiddleware[StateT_co, ContextT]] = (),
response_format: ResponseFormat[ResponseT] | type[ResponseT] | None = None,
response_format: ResponseFormat[ResponseT] | type[ResponseT] | dict[str, Any] | None = None,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to test_json_schema, create_agent's response_format can be a dict.
Which means it has to be supported in AutoStrategy/ToolStrategy/ProviderStrategy/_SchemaSpec

content = message.content
if isinstance(content, str):
return content
if isinstance(content, list):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BaseMessage.content is either a str or a list.
So there should be no need to have a fallback.

@cbornet cbornet force-pushed the langchain-warn-unreachable branch from d559b93 to 67ee999 Compare December 31, 2025 15:38
@mdrxy mdrxy added the typing label Jan 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file (e.g. `pyproject.toml` or `uv.lock`) infra PRs made that include chores, devops, repo meta changes langchain `langchain` package issues & PRs typing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants