Skip to content

feat: parallel tool execution + model-aware safety buffer (closes #1, #2)#4

Merged
Blankll merged 1 commit into
masterfrom
feat/parallel-tool-execution
Jun 17, 2026
Merged

feat: parallel tool execution + model-aware safety buffer (closes #1, #2)#4
Blankll merged 1 commit into
masterfrom
feat/parallel-tool-execution

Conversation

@Blankll

@Blankll Blankll commented Jun 17, 2026

Copy link
Copy Markdown
Member

What

Implements #1 (parallel tool execution) and #2 (model-aware compact safety buffer).

#1 — Parallel tool execution

Add parallel_ok field to Capability. Refactor loop_runner into 3 phases: pre-confirm (seq) → parallel/seq exec via FuturesUnordered → post-result (seq). is_parallel_ok callback decouples from registry.

#2 — Model-aware safety buffer

Replace flat SAFETY_BUFFER_TOKENS = 13,000 with tiered safety_buffer_for_window():

  • ≥200K → 8,000 | ≥32K → 4,000 | <32K → 2,000

Replace flat DEFAULT_COMPACT_RATIO = 0.75 with tiered compact_ratio_for_window():

  • ≥100K → 0.85 | <100K → 0.75

compact_trigger_threshold now accepts &ModelSpec instead of raw capacity.

Verification

  • ✅ Build: all workspaces green
  • ✅ Tests: 62/62 pass (8 new)
  • ✅ Clippy + fmt: clean
  • ✅ Oracle peer-reviewed for both issues

Add parallel_ok field to Capability struct (default false, set true
for read-only tools safe for concurrent execution).

Refactor loop_runner tool execution into 3 phases:
- Phase 1: sequential pre-confirmation (unchanged)
- Phase 2: parallel execution via FuturesUnordered for parallel_ok
  tools with cancellation support and partial result capture
- Phase 3: sequential post-execution with original-order results

Add is_parallel_ok callback parameter to run_agent_loop to decouple
from capability registry — each app passes a closure reading its
own registry, fixing the disconnected-registry bug.

Closes #1
@Blankll Blankll merged commit 4b69c7c into master Jun 17, 2026
13 of 17 checks passed
@Blankll Blankll deleted the feat/parallel-tool-execution branch June 17, 2026 16:50
@Blankll Blankll restored the feat/parallel-tool-execution branch June 17, 2026 16:59
@Blankll Blankll changed the title feat: parallel tool execution for read-only capabilities (closes #1) feat: parallel tool execution + model-aware safety buffer (closes #1, #2) Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant