BuildRiot
Sign in

Article · AI

Deep Agents 0.7.33 adds refusal signals for main agents and subagents

Deep Agents 0.7.33 introduced default errors for recognized model refusals and refusal notices for parent agents. This guide explains the detection boundary and how to preserve completed work, prevent repeated submissions, and route unresolved tasks to human review.

A miniature desk shows clamped refusal envelopes, protected completed paper creations, a blue parent organizer, and an unresolved request on a clipboard for human review.
Illustration: BuildRiot (AI-generated)

Key takeaway

A refusal signal does not establish whether a task is complete or preserve every intermediate result. Developers need durable milestones and explicit dispatch rules to stop refused work from running again.

What the new refusal signals change

Deep Agents 0.7.33 introduced default errors for recognized main-agent refusals and parent-facing notices for subagent refusals. Released on November 5, 2026, it also added notification metadata and task call IDs on subagent checkpoints. Version 0.7.34 followed that day with a summarization fix, so refusal handling was introduced in 0.7.33. Sources: LangChain

According to the implementation pull request, a successful provider response containing a refusal could previously leave the main run looking complete. A refusing subagent could return an empty result. The new signals distinguish these outcomes, but applications still need to determine whether they delivered the requested work. Treat transport success, useful output, and task completion as separate conditions. Sources: LangChain

The release includes default refusal middleware for declarative and general-purpose subagents. Recognized subagent refusals, including refusal-related structured-output failures, produce notices; unrelated errors still propagate. The table below summarizes where the signals appear. Use that distinction to decide which component owns the next action. Sources: LangChain

Table

Where refusal signals appear

SituationDocumented outcome
Main-agent refusalModelRefusalError by default
Recognized subagent refusalParent-facing task-result notice
Refusal-related structured-output failure in a subagentRefusal reported to parent
Asynchronous subagent refusalCorresponding refusal notice
Other subagent errorError propagates
Main-agent refusals raise errors by default, while recognized subagent refusals become notices for the parent.Source: LangChain

Classify outcomes before applying retry policy

LangChain’s middleware documentation limits detection to standardized refusal content blocks and refusal-related structured-output failures. It names OpenAI, Anthropic, and Gemini as producers of these blocks; ordinary prose refusals are not detected. ModelRetryMiddleware does not retry refusals. The refusal middleware requires langchain version 1.4.9 or later. Sources: LangChain

Classify recognized refusals before handling generic exceptions, then permit retries only for known transient failures under a provider-specific policy. Keep parsing failures separate unless there is refusal evidence; an incompatible schema needs a different investigation. For unknown failures, preserve context and escalate instead of assuming another attempt will help. The following categories are recommended application policy.

  • Recognized refusal: stop automatic submission of that task revision and record unresolved work.
  • Known transient failure: retry within an explicit attempt budget.
  • Parsing or validation failure: investigate format compatibility without relabeling it as refusal.
  • Human rejection: record a terminal decision for that action revision.
  • Unknown failure: preserve context for investigation.
  • Useful partial output: return it with explicit omissions and a partial status.

Enforce the stop in both the invocation layer and the task dispatcher. Infrastructure retries and a parent agent’s decision to delegate again are separate paths to repeated work. Record the task ID and revision before dispatch, then block automatic dispatch once that revision is refused. A notice informs the parent; a dispatch rule controls whether another worker runs.

Save milestones for partial recovery

When a subagent raises an exception, changed files and todos do not return through the normal state-update path. Treat that as a boundary on parent updates, without assuming that external effects were reversed or persisted artifacts disappeared. Build recovery around known durable results. For each completed milestone, store the task ID, artifact reference, and completion status. Sources: LangChain

LangGraph’s persistence documentation says MemorySaver and InMemorySaver lose checkpoints on process restart and recommends persistent storage for production. Subgraphs have separate checkpoint namespaces, so parent visibility requires deliberate state sharing. Maintain a manifest separating verified artifacts, provisional output, and unfinished work. After refusal, assemble the partial response from durable artifacts identified in that manifest. Sources: LangChain

Consider a repository review that finishes a dependency inventory before a separate analysis task is refused. Return the inventory, identify the unresolved analysis, and explain how that gap limits the review. Preserve refusal evidence separately: the middleware documentation says the refused reply is not saved to the thread when the error is raised. The thread remains usable, and the documentation recommends custom response inspection for recording refusal state or triggering human intervention. Sources: LangChain

Put human review after a durable stop

Record the unresolved outcome before entering a dedicated human-review node. LangGraph resumes an interrupted node from its beginning, so a model invocation immediately before the interrupt can run again. Its documentation recommends making preceding operations idempotent or separating side effects into different nodes. Keep worker execution and review resume separate to prevent a review response from repeating the refused work. Sources: LangChain

LangGraph interrupts require a checkpointer, a thread ID, and a JSON-serializable payload; resuming uses the same thread ID. Include task identity, revision, refusal reason, completed artifact references, unresolved work, and allowed decisions in the review payload. Deduplicate review items by task ID and revision to avoid competing decisions. The process below is a recommended application design. Sources: LangChain

How it works

Recommended refusal-to-review process

  1. Record refusalIdentify the task revision and retain refusal evidence.
  2. Block redispatchPrevent automatic execution of that refused revision.
  3. Collect durable workAttach verified artifacts and name unfinished work.
  4. Open human reviewCreate one review item for the task revision.
  5. Record the decisionAccept partial work, cancel, or authorize a revised task.
Persist the unresolved outcome before review, and require an explicit decision before creating revised work.

Offer three decisions: accept the partial result, cancel the remaining task, or authorize a revised task. Record the reason for revision and create a new revision only after that decision. Avoid automatic paraphrasing that repeatedly submits equivalent requests. Treat streamed text as provisional because text can reach the client before the middleware raises a refusal error. Sources: LangChain

Choose fallback behavior explicitly

Refusal fallback can submit a refused request to another model, which may also refuse. According to the implementation pull request, user-supplied ModelFallbackMiddleware can handle refusal before the error escapes. Model-level with_fallbacks ordinarily cannot see a refusal detected after the model call. For workflows that prohibit repeated submission, route recognized refusal directly to review. Sources: LangChain

Immediate review adds human work and may interrupt a task another model could complete. If fallback is permitted, document the eligible models, attempt budget, and terminal outcome. Keep attempts visible in the task record so completion does not obscure how the result was obtained. A harness profile can exclude ModelRefusalMiddleware and restore previous behavior. Check configuration to ensure the intended refusal signal remains enabled. Sources: LangChain

Test stop conditions and recovery boundaries

The implementation pull request includes deterministic tests using GenericFakeChatModel for refusal representations, synchronous and asynchronous subagents, structured output, default errors, and fallback interception. It also tests middleware exclusion and ordinary output that should not be classified as refusal. These tests check control flow with predefined responses; they do not establish real-provider detection accuracy, retry-cost savings, or how often parents delegate refused work again. Sources: LangChain

Application acceptance tests should focus on observable workflow outcomes. Exercise the chosen provider adapters, persistence backend, and middleware configuration together. Include a process restart between saving a milestone and assembling a partial response. Verify the following boundaries before enabling unattended execution.

  • A recognized refusal produces zero automatic redispatches of the same task revision.
  • A transient failure consumes only its configured retry budget.
  • A schema failure stays distinct from refusal, and a prose-only refusal exercises the detection gap.
  • Committed artifacts survive refusal and process restart.
  • Resuming human review does not invoke the refused worker again.
  • Duplicate notifications create one review item.
  • Partial output never receives a completed-task label.

Attribution

Sources

  1. 1LangChainDeep Agents changelog
  2. 2LangChainRaise on model refusals by default and report subagent refusals to the parent
  3. 3LangChainPrebuilt middleware
  4. 4LangChainDeep Agents subagent documentation
  5. 5LangChainPersistence
  6. 6LangChainInterrupts
  7. 7LangChainModel refusal handling implementation and tests

Read the original source for full details and context.

Report a problem

Links, dates or what you expected. Do not include passwords or private data.

More on AI

All AI stories
Deep Agents 0.7.33 adds refusal signals for main agents and subagents · BuildRiot