Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
96aa25e
add context compaction to the bash and rlm harnesses
mikasenghaas Aug 27, 2026
25f12a6
bump nano-rlm to the main merge
mikasenghaas Aug 27, 2026
339a785
reserve fixed headroom and truncate tool output
mikasenghaas Aug 27, 2026
514106c
attribute overflow markers to their providers
mikasenghaas Aug 27, 2026
5ea11fc
catch byte-size overflow too
mikasenghaas Aug 27, 2026
7b15d60
compact from the last good state
mikasenghaas Aug 28, 2026
978e650
restrict this PR to the bash harness
mikasenghaas Aug 28, 2026
71d628e
accept a summary from the reasoning channel
mikasenghaas Aug 28, 2026
f07f60a
read the reasoning channel from model extras
mikasenghaas Aug 28, 2026
84eae30
summaries use only non-reasoning output
mikasenghaas Aug 28, 2026
d9bd515
harden first-turn and multimodal compaction paths
mikasenghaas Aug 28, 2026
59bfc65
bound rewritten tool messages too
mikasenghaas Aug 28, 2026
7c05e5c
end the run cleanly when the retry still overflows
mikasenghaas Aug 28, 2026
cad252f
only usage-verified states become checkpoint fallbacks
mikasenghaas Aug 28, 2026
69886a1
add context compaction to the rlm harness
mikasenghaas Aug 28, 2026
60b831c
bump nano-rlm for the reasoning-channel summary
mikasenghaas Aug 28, 2026
7a4779d
bump nano-rlm for the resample claim release
mikasenghaas Aug 28, 2026
4312122
bump nano-rlm for the reasoning-extras fix
mikasenghaas Aug 28, 2026
96aaa66
bump nano-rlm for content-only summaries
mikasenghaas Aug 28, 2026
6e27f78
bump nano-rlm for the checkpoint-fallback floor
mikasenghaas Aug 28, 2026
44ff349
bump nano-rlm for the clean retry-overflow ending
mikasenghaas Aug 28, 2026
3b98836
bump nano-rlm for usage-verified fallbacks
mikasenghaas Aug 28, 2026
0d6e34c
bump nano-rlm for the actionable checkpoint prompt
mikasenghaas Aug 29, 2026
994a146
Merge remote-tracking branch 'origin/main' into feat/context-compaction
mikasenghaas Aug 31, 2026
785ebfb
Merge branch 'feat/context-compaction' into feat/rlm-compaction
mikasenghaas Aug 31, 2026
c19945f
bump nano-rlm for checkpoint-fallback and discovery fixes
mikasenghaas Aug 31, 2026
27e1c91
end cleanly when a compaction floor still overflows
mikasenghaas Aug 31, 2026
3ea210c
Merge branch 'feat/context-compaction' into feat/rlm-compaction
mikasenghaas Aug 31, 2026
d38fa8d
bump nano-rlm for the compaction-floor overflow fix
mikasenghaas Aug 31, 2026
07f45bb
bump nano-rlm for the rollback compacted-flag fix
mikasenghaas Aug 31, 2026
e1c80ac
drop a route-registration comment
mikasenghaas Aug 31, 2026
14a056c
Merge branch 'feat/context-compaction' into feat/rlm-compaction
mikasenghaas Aug 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions verifiers/v1/harnesses/bash/harness.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import os

from pydantic import PositiveInt
from pydantic_config import BaseConfig

from verifiers.v1.clients import ModelContext
from verifiers.v1.configs.harness import HarnessConfig
from verifiers.v1.harness import Harness
Expand All @@ -24,6 +27,14 @@
)


class CompactionConfig(BaseConfig):
"""Context compaction policy for the bash agent loop."""

summarize_at_tokens: PositiveInt | None = None
"""Compact at this token count. When unset, compact when 16k tokens remain below the
model context window when the provider advertises it."""


class BashHarnessConfig(HarnessConfig):
edit: bool = True
"""Offer the local `edit` tool (single-occurrence string replacement in a file) alongside
Expand All @@ -34,6 +45,9 @@ class BashHarnessConfig(HarnessConfig):
eval environment; the key is handed to the program over argv (like the interception secret) so
the agent's `bash` subprocesses don't inherit it."""

compaction: CompactionConfig | None = None
"""Context compaction policy. Set an empty config to use automatic thresholds."""


class BashHarness(Harness[BashHarnessConfig]):
APPENDS_SYSTEM_PROMPT = True
Expand Down Expand Up @@ -69,6 +83,11 @@ async def launch(
args = ["--bash"]
if tool_interception_url:
args.append(f"--tool-interception-url={tool_interception_url}")
if self.config.compaction is not None:
args.append("--compaction")
threshold = self.config.compaction.summarize_at_tokens
if threshold is not None:
args.append(f"--summarize-at-tokens={threshold}")
if self.config.edit:
args.append("--edit")
if self.config.search:
Expand Down
Loading