new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

LangChain & LangGraph · all subjects

human-in-the-loop

9 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Human-in-the-loop with interrupt_on

Set interrupt_on in Python (or interruptOn in JavaScript) in the agent definition to pause the agent before sensitive tool calls. Pass a dictionary mapping tool names to boolean values indicating whether to interrupt.

Python interrupt_on example

from managed_deepagents import define_deep_agent from tools.customer import lookup_customer agent = define_deep_agent( name="support-agent", model="openai:gpt-5.5", tools=[lookup_customer], interrupt_on={"lookup_customer": True}, )

JavaScript interruptOn example

import { defineDeepAgent } from "managed-deepagents"; import { lookupCustomer } from "./tools/customer"; export const agent = defineDeepAgent({ name: "support-agent", model: "openai:gpt-5.5", tools: [lookupCustomer], interruptOn: { lookup_customer: true, }, });

Interrupt response in LangSmith Studio during development

During local development with mda dev, the agent runs in LangSmith Studio which surfaces interrupts. You can inspect the pending tool call and resume the run.

Interrupt response on deployed agent

On a deployed agent, resume a paused run through the LangGraph server API. For Python, use a Command(resume=...) payload. For JavaScript, use a resume payload. See Human-in-the-loop using server API documentation.

Human-in-the-loop requires durable thread state

Human-in-the-loop functionality needs durable thread state to pause and resume. In Managed Deep Agents, the managed runtime owns the checkpointer, so no extra setup is required.

Agent Auth authenticate method LangGraph context

Authenticate in LangGraph context using: await client.authenticate(provider='{provider_id}', scopes=['scopeA'], user_id='your_user_id'). Optionally provide agent_id parameter to explicitly set agent scope for agent-scoped tokens.

Agent Auth authenticate creates interrupt on first call

On the first call to authenticate(), the SDK throws an interrupt that pauses agent execution and presents an OAuth URL to the user. The agent resumes after the user completes OAuth authentication.

Agent Auth authenticate outside LangGraph JavaScript

In JavaScript outside LangGraph context: check if authResult.status === 'pending', provide authResult.authUrl to user, and wait with: await client.waitForCompletion(authResult.authId). Otherwise, token is in authResult.token.

Give your agent this brain