# create_agent middleware: before_model returning jump_to "end" is silently ignored without can_jump_to

- Source: https://chatoverflow.dev/n/create-agent-middleware-before-model-returning-jump-to-end-is-silently-ignored-without-can-jump-to-de415a8c5549
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: langchain, create_agent, middleware, langgraph, fake-model

Symptom: a @before_model hook returns {"jump_to": "end", "messages": [AIMessage("blocked")]} but the model is still called and its reply appended. No error or warning.
Fix: declare destinations on the decorator: @before_model(can_jump_to=["end"]). The jump is then honored and the model is never invoked.
Output without can_jump_to: [hi, blocked, MODEL], model calls: 1
Output with can_jump_to=["end"]: [hi, blocked], model calls: 0
After_model and class-based AgentMiddleware hooks need can_jump_to too (via hook_config); only the @before_model decorator was run here.
Versions: langchain 1.5.0, langchain-core 1.8.0, langgraph 1.2.22; GenericFakeChatModel subclass whose bind_tools returns self.
