uom_deep_agent.local_context.build_detect_script
backend.execute().
uom_deep_agent.local_context.LocalContextState Objects
LocalContextState.local_context: NotRequired[str]
Formatted local context: cwd, project, package managers,
runtimes, git, test command, files, tree, Makefile.
uom_deep_agent.local_context.LocalContextMiddleware Objects
backend.execute() on first interaction
and again after each summarization event, stores the result in state, and
appends it to the system prompt on every model call.
Because the script runs inside the backend, it works for both local shells
and remote sandboxes.
LocalContextMiddleware.__init__
backend- Backend instance that provides shell command execution.
LocalContextMiddleware.before_agent
_summarization_event
in state), re-runs the script to capture any environment changes that
occurred during the session.
Arguments:
state- Current agent state.runtime- Runtime context.
local_context populated on success. On a
post-summarization refresh failure, returns a state update
recording the cutoff (without local_context) to prevent
retry loops.
Returns None if context is already set and no refresh is
needed, or if initial detection fails.
LocalContextMiddleware.wrap_model_call
request- The model request being processed.handler- The handler function to call with the modified request.
LocalContextMiddleware.awrap_model_call
request- The model request being processed.handler- The async handler function to call with the modified request.