hermes-agent/agent
Teknium cb1e059a98 fix(agent): reader/writer path roles in parallel batch planner — search_files no longer races batched writes
The parallel tool-batch planner treated search_files as unconditionally
parallel-safe (_PARALLEL_SAFE_TOOLS) with no path reservation, so a
batch of patch(path=X) + search_files(path=dir(X)) landed in one
concurrent segment and the search could observe pre-mutation file
content — a same-block write->read stale-read race.

Fix the class, not the site: path-scoped reservations now carry a
reader/writer role.

- search_files joins _PATH_SCOPED_TOOLS as a READER, reserving its
  search root (default '.', matching the tool's default) instead of
  bypassing path checks entirely.
- Overlap only conflicts when a WRITER is on either side: a write into
  a searched/read subtree splits segments (ordered behind the write),
  while reader<->reader overlap — previously split needlessly — now
  stays parallel (concurrent reads commute).
- write_file/patch keep their existing writer barrier semantics.

Prior art surveyed for this design: Codex CLI's RwLock read/write
barrier (readers share, writers exclusive), Claude Code's
isConcurrencySafe partitioning, and gemini-cli's contiguous
parallelizable batching — all converge on reader-shared/writer-
exclusive with contiguous-order preservation, which this planner
already had for read_file/write_file/patch; this closes the
search_files gap and adds the missing reader/reader concession.

Verified by sabotage run (tests fail against the old planner) and an
E2E script exercising the real planner + real file I/O.
2026-08-01 10:46:25 -07:00
..
lsp perf: use load_config_readonly() at read-only call sites in agent/ 2026-07-29 15:28:15 -07:00
monitoring feat(monitoring): add hermes.gateway.background_delegations (unit/slot count) 2026-07-25 02:30:20 +00:00
pet
proxy_sources fix(windows): sweep remaining unguarded text-mode subprocess sites codebase-wide 2026-07-24 11:45:57 -07:00
secret_sources refactor: single build_subprocess_env() factory for all child-process spawns (profile + secret-scrub single owner) 2026-07-29 10:14:11 -07:00
transports fix(codex): defang reserved Harmony tokens in requests 2026-07-31 22:53:20 -07:00
__init__.py
account_usage.py
agent_init.py fix(caching): honor prompt_caching.cache_ttl disable in config 2026-08-01 14:14:15 +05:30
agent_runtime_helpers.py refactor(prompt-caching): collapse triplicated destination-plan and label parsing 2026-08-01 15:39:58 +05:30
anthropic_adapter.py nous portal anthropic wire 2026-07-27 11:53:48 -04:00
async_utils.py
aux_accounting.py
auxiliary_client.py fix(auxiliary): replan cache sections on the async fallback path too 2026-08-01 15:39:58 +05:30
azure_identity_adapter.py
backend_identity.py refactor(fallback): single owner for backend identity and failure-scoped skips 2026-07-26 23:41:54 -07:00
background_review.py fix(background-review): reject unresolved failures as skills 2026-07-31 22:33:03 -07:00
battery.py
bedrock_adapter.py
billing_links.py
billing_usage.py chore: remove unused imports and dead locals (ruff F401/F841 sweep) 2026-07-29 11:53:39 -07:00
billing_view.py chore: remove unused imports and dead locals (ruff F401/F841 sweep) 2026-07-29 11:53:39 -07:00
bounded_response.py
browser_provider.py
browser_registry.py
chat_completion_helpers.py perf(prompt-caching): preserve tool-loop cache boundaries (#20880) 2026-08-01 14:27:12 +05:30
codex_responses_adapter.py fix(codex): defang reserved Harmony tokens in requests 2026-07-31 22:53:20 -07:00
codex_runtime.py fix(codex): don't retry after a valid response.completed on drain error 2026-07-29 16:41:39 -03:00
coding_context.py perf: use load_config_readonly() at read-only call sites in agent/ 2026-07-29 15:28:15 -07:00
context_breakdown.py feat(cli,gateway): unify /context into a visual context-usage breakdown 2026-07-26 18:06:21 -07:00
context_compressor.py refactor(compression): fold simplify-pass findings into feasibility skip 2026-08-01 16:00:52 +05:30
context_engine.py fix(context-engine): snapshot select_context read-only inputs; scope on_turn_complete coverage doc 2026-07-23 19:44:35 -07:00
context_references.py fix(context): keep @ref tokens inline instead of stripping them from the prompt 2026-07-27 22:55:18 -05:00
conversation_compression.py fix(compression): add pre-LLM feasibility check to skip costly no-op summaries 2026-08-01 16:00:52 +05:30
conversation_loop.py perf(prompt-caching): preserve tool-loop cache boundaries (#20880) 2026-08-01 14:27:12 +05:30
copilot_acp_client.py fix(core,cli,gateway,plugins): add encoding='utf-8' to read_text() calls 2026-07-24 17:10:39 -07:00
credential_persistence.py
credential_pool.py fix(credential_pool): use source-path-based write-through to root (#74339) 2026-07-31 22:32:48 -07:00
credential_sources.py fix(windows): sweep remaining bare read_text/write_text sites + linter rule 2026-07-24 17:10:39 -07:00
credits_tracker.py fix(credits): reintroduce grant_spent, gated on an in-session crossing (#73634) 2026-07-28 21:36:23 +00:00
curator.py perf: use load_config_readonly() at read-only call sites in agent/ 2026-07-29 15:28:15 -07:00
curator_backup.py fix(curator): restore the real skills tree when a rollback extract dies part-way 2026-07-31 22:34:57 -07:00
delegation_context.py fix(delegation): prevent child HERMES_SESSION_ID leak into parent process env 2026-07-31 22:32:55 -07:00
display.py
error_classifier.py fix(moa): stream completed aggregator responses safely 2026-07-31 21:52:35 -07:00
errors.py
file_safety.py
gemini_native_adapter.py fix(gemini): sweep hardcoded Gemini default models to gemini-3.6-flash (#32360) 2026-07-28 18:17:56 -07:00
gemini_schema.py fix(gemini): preserve typed enum constraints as strings 2026-07-26 20:59:16 -07:00
i18n.py perf: use load_config_readonly() at read-only call sites in agent/ 2026-07-29 15:28:15 -07:00
image_gen_provider.py
image_gen_registry.py perf: use load_config_readonly() at read-only call sites in agent/ 2026-07-29 15:28:15 -07:00
image_routing.py
insights.py perf(state): apply per-call token accounting on a background single-writer queue 2026-07-28 18:47:54 +05:30
iteration_budget.py feat: raise default tool-calling iteration limit from 90 to 500 2026-07-26 12:54:45 -07:00
jiter_preload.py
kanban_stop.py
learn_prompt.py
learning_graph.py
learning_graph_render.py chore: remove unused imports and dead locals (ruff F401/F841 sweep) 2026-07-29 11:53:39 -07:00
learning_mutations.py
lmstudio_reasoning.py
manual_compression_feedback.py
markdown_tables.py
memory_manager.py fix(memory): honor disabled toolsets for provider tools 2026-07-24 13:00:53 +05:30
memory_provider.py
message_content.py
message_sanitization.py refactor(agent): single-owner call_id + reasoning_content sanitization policies (wire-parity verified) 2026-07-29 12:29:39 -07:00
moa_loop.py refactor(prompt-caching): collapse triplicated destination-plan and label parsing 2026-08-01 15:39:58 +05:30
moa_trace.py
model_metadata.py fix: widen fallback warning to the sibling custom-endpoint 256K path 2026-08-01 15:05:05 +05:30
models_dev.py Revert "remove Vercel AI Gateway and Vercel Sandbox (#33067)" 2026-07-29 19:48:37 -07:00
moonshot_schema.py
nous_rate_guard.py fix: decode config and state files as UTF-8 on non-UTF-8 locales 2026-07-24 17:10:39 -07:00
onboarding.py
oneshot.py
plugin_llm.py perf: use load_config_readonly() at read-only call sites in agent/ 2026-07-29 15:28:15 -07:00
portal_tags.py
process_bootstrap.py
prompt_builder.py feat(terminal): raise Docker sandbox /dev/shm to 1g by default (configurable) 2026-07-31 21:31:51 -07:00
prompt_caching.py perf(prompt-caching): make PromptCachePlan.marker_count lazy 2026-08-01 15:39:58 +05:30
rate_limit_tracker.py
reactions.py
reasoning_timeouts.py fix(compression): coherent context_length setter — no-op guard, re-floor on new window, un-strandable init log 2026-07-28 20:04:58 +05:30
redact.py perf(redact): eliminate exponential backtracking in config-key patterns 2026-08-01 15:58:25 +05:30
relay_llm.py fix(moa): carry completed responses through the managed Relay path 2026-07-31 21:52:35 -07:00
relay_runtime.py fix(relay): close logical calls in stack order 2026-07-28 10:19:53 -07:00
relay_tools.py Reapply "feat(observability): integrate NeMo Relay runtime and shared metrics" 2026-07-27 21:10:51 -07:00
replay_cleanup.py
retry_utils.py refactor: single shared Retry-After parser 2026-07-29 10:13:50 -07:00
runtime_cwd.py
secret_scope.py
shell_hooks.py feat(delegate): expose redacted child tool history 2026-07-26 20:36:47 -07:00
skill_bundles.py
skill_commands.py fix(gateway): project a /skill turn onto its invocation for every client 2026-07-28 03:44:17 -05:00
skill_preprocessing.py perf: use load_config_readonly() at read-only call sites in agent/ 2026-07-29 15:28:15 -07:00
skill_utils.py Merge origin/main into feat/hsp-sync-client 2026-07-29 13:01:36 -07:00
ssl_guard.py fix(ssl): detect and repair a missing certifi cacert.pem via existing venv-repair infra 2026-07-24 15:53:38 -07:00
ssl_verify.py
stream_diag.py
stream_single_writer.py
subagent_lifecycle.py chore: remove unused imports and dead locals (ruff F401/F841 sweep) 2026-07-29 11:53:39 -07:00
subdirectory_hints.py
subscription_view.py
system_prompt.py refactor(agent): share static-prefix reconstruction, memoize failed rebuilds 2026-07-28 01:10:05 +05:30
think_scrubber.py
thinking_timeout_guidance.py
thread_scoped_output.py
title_generator.py perf: use load_config_readonly() at read-only call sites in agent/ 2026-07-29 15:28:15 -07:00
tool_dispatch_helpers.py fix(agent): reader/writer path roles in parallel batch planner — search_files no longer races batched writes 2026-08-01 10:46:25 -07:00
tool_executor.py fix(agent): preserve /steer through turn-budget enforcement 2026-07-31 22:32:52 -07:00
tool_guardrails.py refactor(guardrails): make runaway-loop caps per-turn, not session-total 2026-07-26 21:27:45 -07:00
tool_result_classification.py
trace_upload.py fix(windows): sweep remaining unguarded text-mode subprocess sites codebase-wide 2026-07-24 11:45:57 -07:00
trajectory.py
transcription_provider.py
transcription_registry.py
tts_provider.py
tts_registry.py
turn_context.py Merge upstream main into fix/hermes-relay-anthropic-context 2026-07-28 08:10:58 -07:00
turn_finalizer.py fix(agent): invalidate flush-scan cursor at the defrag marker-pop sibling site 2026-07-31 23:18:12 -07:00
turn_retry_state.py fix(copilot): recover from stale/degraded token 400 AND expired IDE-token 401 2026-07-31 22:31:09 -07:00
turn_summary.py fix(cli): report unknown line deltas for content-free diffs instead of +0 -0 2026-07-26 17:47:51 -07:00
usage_pricing.py Revert "remove Vercel AI Gateway and Vercel Sandbox (#33067)" 2026-07-29 19:48:37 -07:00
verification_evidence.py fix(state): make journal mode canonical and behaviorally verified 2026-07-29 18:13:09 -07:00
verification_stop.py flux3 messaging system fixes 2026-07-30 15:20:09 -07:00
verify_hooks.py
vertex_adapter.py
video_gen_provider.py
video_gen_registry.py perf: use load_config_readonly() at read-only call sites in agent/ 2026-07-29 15:28:15 -07:00
web_search_provider.py
web_search_registry.py perf: use load_config_readonly() at read-only call sites in agent/ 2026-07-29 15:28:15 -07:00