mirror of
https://github.com/RightNow-AI/openfang.git
synced 2026-04-25 17:25:11 +02:00
When an agent had a context.md file updated externally (e.g. a cron job refreshing live market data), the updated content never reached the LLM during an active session. The file was effectively cached for the lifetime of the conversation. The runtime now reads context.md from the agent workspace once per turn, right before the system prompt is built, and injects it as a dedicated 'Live Context' section. Agents that still want the old cache-at-start behaviour can opt back in with 'cache_context = true' on the manifest. - new openfang-runtime::agent_context module with a small per-path cache - if a re-read fails after a previous success, fall back to the cached content with a warning instead of dropping context mid-conversation - new PromptContext.context_md field wired up in both kernel streaming and non-streaming paths - one small disk read per agent turn (not per streaming token); file size capped at 32 KB like the other identity files Made-with: Cursor
60 lines
1.4 KiB
Rust
60 lines
1.4 KiB
Rust
//! Agent runtime and execution environment.
|
|
//!
|
|
//! Manages the agent execution loop, LLM driver abstraction,
|
|
//! tool execution, and WASM sandboxing for untrusted skill/plugin code.
|
|
|
|
/// Default User-Agent header sent with all outgoing HTTP requests.
|
|
/// Some LLM providers (e.g. Moonshot, Qwen) reject requests without one.
|
|
pub const USER_AGENT: &str = "openfang/0.3.48";
|
|
|
|
pub mod a2a;
|
|
pub mod agent_context;
|
|
pub mod agent_loop;
|
|
pub mod apply_patch;
|
|
pub mod audit;
|
|
pub mod auth_cooldown;
|
|
pub mod browser;
|
|
pub mod command_lane;
|
|
pub mod compactor;
|
|
pub mod context_budget;
|
|
pub mod context_overflow;
|
|
pub mod copilot_oauth;
|
|
pub mod docker_sandbox;
|
|
pub mod drivers;
|
|
pub mod embedding;
|
|
pub mod graceful_shutdown;
|
|
pub mod hooks;
|
|
pub mod host_functions;
|
|
pub mod image_gen;
|
|
pub mod kernel_handle;
|
|
pub mod link_understanding;
|
|
pub mod llm_driver;
|
|
pub mod llm_errors;
|
|
pub mod loop_guard;
|
|
pub mod mcp;
|
|
pub mod mcp_server;
|
|
pub mod media_understanding;
|
|
pub mod model_catalog;
|
|
pub mod process_manager;
|
|
pub mod prompt_builder;
|
|
pub mod provider_health;
|
|
pub mod python_runtime;
|
|
pub mod reply_directives;
|
|
pub mod retry;
|
|
pub mod routing;
|
|
pub mod sandbox;
|
|
pub mod session_repair;
|
|
pub mod shell_bleed;
|
|
pub mod str_utils;
|
|
pub mod subprocess_sandbox;
|
|
pub mod think_filter;
|
|
pub mod tool_policy;
|
|
pub mod tool_runner;
|
|
pub mod tts;
|
|
pub mod web_cache;
|
|
pub mod web_content;
|
|
pub mod web_fetch;
|
|
pub mod web_search;
|
|
pub mod workspace_context;
|
|
pub mod workspace_sandbox;
|