Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs(context): document compaction strategy field and remove unused import

Steven Enamakel148dc6e6dbbf
diff --git a/crates/openhuman-core/src/agent/context/README.md b/crates/openhuman-core/src/agent/context/README.md
index 9e31d149a4..d8c1893b6a 100644
--- a/crates/openhuman-core/src/agent/context/README.md
+++ b/crates/openhuman-core/src/agent/context/README.md
@@ -17,7 +17,7 @@ Global context management for agent sessions: system-prompt assembly, per-sessio
| File | Role |
| --- | --- |
| `crates/openhuman-core/src/agent/context/mod.rs` | Module docstring, `pub mod` decls, `pub use` re-exports, and the three shared constants (`DEFAULT_TOOL_RESULT_BUDGET_BYTES`, `CLEARED_PLACEHOLDER`, `DEFAULT_KEEP_RECENT_TOOL_RESULTS`). No other logic. |
-| `crates/openhuman-core/src/agent/context/manager.rs` | `ContextManager`: per-session handle agents hold. Owns the default prompt builder, `ContextStatsState`, and the `ContextConfig`-derived knobs. Surfaces `build_system_prompt` / `build_system_prompt_tiered`, `stats()`, the getters the tinyagents turn reads (`tool_result_budget_bytes`, `compaction_enabled`, `microcompact_keep_recent`, `autocompact_enabled`, `compaction_trigger_tokens`, `prefer_markdown_tool_output`), and the session-memory trigger/mark methods. |
+| `crates/openhuman-core/src/agent/context/manager.rs` | `ContextManager`: per-session handle agents hold. Owns the default prompt builder, `ContextStatsState`, and the `ContextConfig`-derived knobs. Surfaces `build_system_prompt` / `build_system_prompt_tiered`, `stats()`, the getters the tinyagents turn reads (`tool_result_budget_bytes`, `compaction_enabled`, `microcompact_keep_recent`, `autocompact_enabled`, `compaction` (trigger override and strategy), `prefer_markdown_tool_output`), and the session-memory trigger/mark methods. |
| `crates/openhuman-core/src/agent/context/stats.rs` | `ContextStatsState`: last provider usage, context-window utilisation, and the shared `SessionMemoryHandle` (`Arc<Mutex<SessionMemoryState>>`). Pure state; issues no LLM calls and does not mutate history. |
| `crates/openhuman-core/src/agent/context/session_memory.rs` | `SessionMemoryState` / `SessionMemoryConfig`: threshold-gated `should_extract` decision (token growth, tool calls, and turns must all cross) and extraction bookkeeping. Holds `ARCHIVIST_EXTRACTION_PROMPT`. State-tracking only; does not spawn the archivist. |
| `crates/openhuman-core/src/agent/context/channels_prompt.rs` | Bespoke free functions `build_system_prompt(...)` / `build_system_prompt_with_identity(...)` (plus `PromptIdentityOverride`, `ProjectContextPlacement`, `render_project_context`) for channel runtimes (Discord/Slack/Telegram/…). Byte-stable for prefix-cache hits; injects workspace bootstrap files (`SOUL.md`, `IDENTITY.md`, optional `PROFILE.md`/`MEMORY.md`, with profile overrides for `SOUL.md`/`MEMORY.md`), tools, safety, skills, runtime, and channel-capabilities sections. |
@@ -70,7 +70,7 @@ The durable substrate session-memory targets is the workspace `MEMORY.md` file,
## Dependencies
-- `crate::config`: `ContextConfig` (`config/schema/context.rs`): `enabled`, `microcompact_enabled` / `microcompact_keep_recent`, `autocompact_enabled`, `compaction_trigger_tokens` (absolute summarization trigger for benchmarks; env `OPENHUMAN_COMPACTION_TRIGGER_TOKENS`), `compaction_enabled`, `tool_result_budget_bytes`, `prefer_markdown_tool_output`, `summarizer_model`, and the embedded `session_memory: SessionMemoryConfig`.
+- `crate::config`: `ContextConfig` (`config/schema/context.rs`): `enabled`, `microcompact_enabled` / `microcompact_keep_recent`, `autocompact_enabled`, `compaction_trigger_tokens` (absolute summarization trigger for benchmarks; env `OPENHUMAN_COMPACTION_TRIGGER_TOKENS`), `compaction_strategy` (env `OPENHUMAN_COMPACTION_STRATEGY`), `compaction_enabled`, `tool_result_budget_bytes`, `prefer_markdown_tool_output`, `summarizer_model`, and the embedded `session_memory: SessionMemoryConfig`.
- `crate::inference::provider::UsageInfo`: fed into `record_usage`.
- `crate::agent::prompts`: owns prompt rendering; `channels_prompt.rs` uses `inject_inline_content`.
- `crate::skills::Workflow`: `channels_prompt.rs` renders the available-skills section from a `&[Workflow]`.
diff --git a/crates/openhuman-core/src/agent/session_host/artifact_wiring.rs b/crates/openhuman-core/src/agent/session_host/artifact_wiring.rs
index c5bc27e2f3..67a98a6a78 100644
--- a/crates/openhuman-core/src/agent/session_host/artifact_wiring.rs
+++ b/crates/openhuman-core/src/agent/session_host/artifact_wiring.rs
@@ -9,7 +9,6 @@ use std::path::{Path, PathBuf};
use crate::agent::harness::tool_result_artifacts::{
legacy_action_dir_store, new_tool_result_store,
};
-use crate::security::policy::tool_result_artifacts_dir;
use tinyagents_harness::artifacts::tool_results::ToolResultArtifactStore;
/// How long another session's tool-result artifacts survive before a later