Use names that communicate intent and framework semantics—especially for (a) schemas and (b) callback parameters whose names are used for injection/dispatch.
Standards:
state, runtime, request) rather than relying on positional arguments or renaming._self, _runtime) instead of adding suppression comments.MULTILINE, the name should not hide that nuance).Example (callback arg naming + unused naming):
from typing import Any
from langgraph.types import interrupt
def before_agent(state: Any, runtime: Any) -> dict[str, Any]:
# framework-injected names: keep as-is
return {"ok": True, "state": state, "runtime": runtime}
def before_agent_unused(runtime: Any, state: Any) -> dict[str, Any]:
# if intentionally unused, use underscore prefix
_ = state
return {"ok": True}
async def headless_coroutine(_config: Any, **kwargs: Any) -> Any:
# intentionally unused config -> underscore
return interrupt({"args": kwargs})
Applying this will reduce confusion in schema-driven tooling, prevent subtle runtime bugs caused by incorrect parameter names, and make behavior easier to understand during review.
Enter the URL of a public GitHub repository