Eilen Shin aaca3eeaeb
refactor(agent): ground runtime decisions in structured evidence (#7986)
* refactor(agent): ground runtime decisions in structured evidence

Use producer status and structured errors for tool recovery, preserve memory context without lexical confirmation, and remove predetermined receipt and skill conclusions.

Require explicit MCP discovery and authenticated schedule trial actions. Preserve authorization, ownership, isolation, and bounded execution; update documentation and regression coverage.

* test(sandbox): expect read_file initialization error callback

* fix(agent): address evidence review follow-ups

* fix(agent): preserve retry budgets for OpenAI transport errors

* fix(agent): expose tool execution status in model requests

Project validated execution metadata and exact tool text into request-only JSON so status survives provider serialization. Preserve stored results and receipt hashes, cover SDK and graph boundaries, and migrate replay input hashes without changing recorded responses.

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-11-08 22:00:23 +08:00

21 lines
582 B
Python

"""Structured model response errors shared by providers and middleware."""
from __future__ import annotations
from langchain_core.messages import AIMessage
class EmptyModelResponseError(RuntimeError):
"""The model completed normally without producing persistent content."""
code = "EMPTY_RESPONSE"
def __init__(
self,
message: str = "Model returned a completed response with no content",
*,
response_message: AIMessage | None = None,
) -> None:
super().__init__(message)
self.response_message = response_message