hermes-bsd/agent
Teknium 38c8a9c10f
feat(memory): batch operations for single-turn memory updates (#48507)
The memory tool was strictly one-op-per-call. With the store running near
its char limit by design, a new add that would overflow gets rejected with
'consolidate now, then retry' -- but the model could not consolidate and add
in one call. It had to remove/replace across several turns, then retry the
add, each turn re-sending the whole conversation context. Expensive thrash.

Add an 'operations' array: a list of add/replace/remove ops applied
atomically against the FINAL char budget. The model frees space and adds new
entries in ONE call, even when an add alone would overflow. All-or-nothing:
any bad op aborts the whole batch, nothing written.

Root-cause note: the two agent-level memory interception sites
(agent_runtime_helpers.py, tool_executor.py) silently dropped any param not
in their explicit kwarg list, so 'operations' never reached the handler and
batch calls failed with 'Unknown action None'. Both now pass it through and
bridge each add/replace op to external memory providers.

Also: success response is now terminal (done=true + 'do not repeat' note,
no full-entries echo that invited re-edits); schema rewritten to lead with
the batch mechanism and an explicit one-shot stop rule (2138 -> 1476 chars).

Live-verified: near-full consolidate-and-add went 7 calls -> 1 call,
stable across 3 reps. 103 memory/approval tests + 398 background-review/
run_agent tests green; 6 new batch tests added.
2026-06-18 10:19:33 -07:00
..
lsp fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls 2026-06-08 22:46:57 -07:00
secret_sources fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls 2026-06-08 22:46:57 -07:00
transports fix(xai): scope native web_search to swap-only + reconcile composer ctx to 200k 2026-06-17 17:33:32 -07:00
__init__.py fix(agent): preload jiter native parser 2026-05-28 00:20:11 -07:00
account_usage.py feat(billing): /credits command — balance + portal top-up handoff (#44776) 2026-06-12 08:51:10 +00:00
agent_init.py Merge upstream/main into OpenViking setup-UX (salvage #32445) 2026-06-18 11:28:51 +05:30
agent_runtime_helpers.py feat(memory): batch operations for single-turn memory updates (#48507) 2026-06-18 10:19:33 -07:00
anthropic_adapter.py fix(anthropic): also normalize MCP-server tool names to mcp__ on OAuth wire 2026-06-17 13:20:29 +05:30
async_utils.py
auxiliary_client.py fix(auxiliary): honor main fallback chain for auto tasks (#47235) 2026-06-16 06:23:24 -07:00
azure_identity_adapter.py
background_review.py feat(memory): batch operations for single-turn memory updates (#48507) 2026-06-18 10:19:33 -07:00
bedrock_adapter.py fix(bedrock): check boto3 version >= 1.34.59 before using converse_stream 2026-06-15 05:25:17 -07:00
browser_provider.py
browser_registry.py style: restore PEP8 blank-line separation after dead-code removal 2026-05-29 04:22:27 -07:00
chat_completion_helpers.py fix(bedrock): fall back to non-streaming InvokeModel when IAM denies InvokeModelWithResponseStream (#44293) 2026-06-11 07:15:30 -07:00
codex_responses_adapter.py fix(xai): OAuth Responses native web_search, incomplete guard, grok-composer context 2026-06-17 17:33:32 -07:00
codex_runtime.py fix(codex): record app-server token usage in session accounting 2026-06-09 02:46:04 -07:00
coding_context.py fix(coding): teach agents terminal env state persists 2026-06-11 19:50:08 -05:00
context_compressor.py fix(agent): add metadata flag to context compression summary messages (#38389) 2026-06-12 16:47:15 -07:00
context_engine.py fix(compression): avoid repeat preflight compaction from rough estimates 2026-05-29 19:05:03 -07:00
context_references.py fix(agent): make a binary @file: reference actionable instead of a dead end 2026-06-09 19:16:46 -05:00
conversation_compression.py feat(hooks): session:compress event_callback for MemPalace sync 2026-06-16 11:45:36 -07:00
conversation_loop.py fix(agent): dampen empty-name phantom tool-call loop (#47967) (#48109) 2026-06-17 17:32:14 -07:00
copilot_acp_client.py fix: make profile subprocess HOME policy explicit 2026-06-14 03:20:21 -07:00
credential_persistence.py
credential_pool.py fix(auth): add Codex OAuth accounts as distinct pool entries 2026-06-08 11:57:03 -07:00
credential_sources.py
credits_tracker.py feat(billing): /credits command — balance + portal top-up handoff (#44776) 2026-06-12 08:51:10 +00:00
curator.py feat(curator): make skill consolidation opt-in (prune stays default-on) (#47840) 2026-06-17 05:20:32 -07:00
curator_backup.py fix(curator): stop the rollback safety snapshot from pruning its target 2026-06-17 05:40:05 -07:00
display.py fix: harden salvaged session and browser improvements 2026-06-15 07:46:34 -07:00
error_classifier.py fix(agent): route 'thinking blocks cannot be modified' 400 to recovery 2026-06-10 12:39:44 -07:00
errors.py fix(agent,gateway,doctor): add SSL CA cert bundle fail-fast guard 2026-06-13 21:14:32 -07:00
file_safety.py fix(file-safety): relax user-write deny policy (#45947) 2026-06-14 02:07:32 -07:00
gemini_cloudcode_adapter.py
gemini_native_adapter.py fix(gemini): strip native self prefixes before generateContent (#36141) 2026-06-13 13:47:08 -07:00
gemini_schema.py
google_code_assist.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
google_oauth.py fix(auth): don't launch a text-mode browser inside the terminal for OAuth (#34479) 2026-05-29 01:23:06 -07:00
i18n.py fix(packaging): ship locales/ i18n catalogs in wheel, sdist, and Nix (#38383) 2026-06-03 12:00:27 -07:00
image_gen_provider.py
image_gen_registry.py
image_routing.py fix(vision): honor custom_providers per-model supports_vision (#41036) 2026-06-07 21:50:57 -07:00
insights.py refactor(insights): drop dead pricing/duration wrappers, call usage_pricing directly (#40618) 2026-06-07 18:33:20 -07:00
iteration_budget.py
jiter_preload.py fix(agent): preload jiter native parser 2026-05-28 00:20:11 -07:00
lmstudio_reasoning.py
manual_compression_feedback.py
markdown_tables.py
memory_manager.py fix(memory): strip skill scaffolding for all providers, not just openviking 2026-06-16 10:37:37 -07:00
memory_provider.py feat(memory): add rewound kwarg to on_session_switch hook 2026-06-01 01:22:38 -07:00
message_sanitization.py revert: drop cumulative-resend tool-arg heuristic from shared streaming path (#35718) (#35860) 2026-05-31 06:14:32 -07:00
model_metadata.py fix(xai): scope native web_search to swap-only + reconcile composer ctx to 200k 2026-06-17 17:33:32 -07:00
models_dev.py
moonshot_schema.py fix(moonshot): handle union type arrays in tool schemas 2026-06-13 05:51:41 -07:00
nous_rate_guard.py
onboarding.py feat(onboarding): opt-in structured profile-build path on first contact (#41114) 2026-06-07 08:36:48 -07:00
plugin_llm.py
portal_tags.py
process_bootstrap.py
prompt_builder.py feat(prompt): scale context-file cap to model window + point agent at truncated file (#47846) 2026-06-17 05:40:26 -07:00
prompt_caching.py
rate_limit_tracker.py
redact.py redact secrets in API request debug dumps 2026-06-15 05:31:21 -07:00
retry_utils.py
runtime_cwd.py fix(desktop): stabilize project folder sessions (#37586) 2026-06-02 20:23:09 +00:00
shell_hooks.py
skill_bundles.py
skill_commands.py fix(memory): strip skill scaffolding for all providers, not just openviking 2026-06-16 10:37:37 -07:00
skill_preprocessing.py fix: prevent TUI gateway stdin EOF crash across all TUI-context subprocess calls 2026-06-08 22:46:57 -07:00
skill_utils.py fix(skills): ignore support docs in skill discovery 2026-06-16 13:08:34 -07:00
ssl_guard.py fix(ssl): align guard docs and escape hatch 2026-06-13 21:14:32 -07:00
stream_diag.py feat(agent): buffer retry/fallback status, surface only on terminal failure (#33816) 2026-05-28 04:53:27 -07:00
subdirectory_hints.py
system_prompt.py feat(prompt): scale context-file cap to model window + point agent at truncated file (#47846) 2026-06-17 05:40:26 -07:00
think_scrubber.py
title_generator.py
tool_dispatch_helpers.py
tool_executor.py feat(memory): batch operations for single-turn memory updates (#48507) 2026-06-18 10:19:33 -07:00
tool_guardrails.py
tool_result_classification.py
trajectory.py
transcription_provider.py
transcription_registry.py
tts_provider.py
tts_registry.py
turn_context.py feat(gateway): inject stable human-readable message timestamps 2026-06-16 15:49:59 -07:00
turn_finalizer.py refactor(agent): extract run_conversation post-loop tail into finalize_turn (god-file Phase 1) 2026-06-08 09:42:23 -07:00
turn_retry_state.py refactor(agent): consolidate inner-retry-loop recovery flags into TurnRetryState (god-file Phase 1b) 2026-06-07 22:42:05 -07:00
usage_pricing.py fix(model): require confirmation for expensive model selections 2026-06-10 00:24:06 -07:00
video_gen_provider.py
video_gen_registry.py
web_search_provider.py chore(web): remove web_crawl tool + provider crawl plumbing (#33824) 2026-05-28 04:52:42 -07:00
web_search_registry.py chore(web): remove web_crawl tool + provider crawl plumbing (#33824) 2026-05-28 04:52:42 -07:00