hermes-agent/agent
kshitijk4poor 49f50c68a0 fix(compression): coherent context_length setter — no-op guard, re-floor on new window, un-strandable init log
Review-pass findings on the lazy-init deferral:

- No-op guard: the codex app-server usage callback assigns
  compressor.context_length on EVERY response (same window each time).
  The setter unconditionally invalidated the derived budgets, wiping
  runtime corrections applied directly to threshold_tokens /
  tail_token_budget (aux-context threshold sync) — those persisted on
  main's eager init. Same-value assignment is now a no-op.

- Re-floor on genuinely new window: the setter invalidates budgets but
  previously kept the stale threshold_percent, so a codex window switch
  recomputed threshold_tokens from the new window with the old model's
  floored percent. Re-apply the raise-only small-context floor from
  _base_threshold_percent so percent and tokens derive from the same
  window (guarded with getattr for object.__new__ test instances).

- Init log extracted to _emit_init_summary_once() and also fired from
  the setter path, so a consumer assigning context_length before any
  read no longer strands the startup line forever.

- threshold_tokens getter resolves the window into a local before
  reading threshold_percent — correctness no longer depends on
  left-to-right argument evaluation order.

- reasoning_timeouts: fix inaccurate 'tuples are immutable' comment
  (the container is a list; safety comes from build-once-at-import),
  document why the slug stays in the tuple.

Adds TestContextLengthSetterCoherence (3 tests): same-value assignment
preserves overrides; new-window assignment re-floors both directions.
2026-07-28 20:04:58 +05:30
..
lsp
pet
proxy_sources
secret_sources
transports
__init__.py
account_usage.py
agent_init.py fix(xai): send Hermes-Agent User-Agent on chat/completions 2026-07-27 17:47:28 -07:00
agent_runtime_helpers.py fix(agent): shut down sockets on httpx mount pools during interrupt abort 2026-07-28 18:07:44 +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 Revert "feat(observability): integrate NeMo Relay runtime and shared metrics" 2026-07-27 22:28:08 -04:00
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
battery.py
bedrock_adapter.py
billing_links.py
billing_usage.py
billing_view.py feat(billing): carry the payment-method union through to clients (#71542) 2026-07-27 01:49:43 +05:30
bounded_response.py
browser_provider.py
browser_registry.py
chat_completion_helpers.py perf(agent): reuse the per-request OpenAI wire client across sequential LLM calls 2026-07-28 19:06:59 +05:30
codex_responses_adapter.py
codex_runtime.py perf(agent): reuse the per-request OpenAI wire client across sequential LLM calls 2026-07-28 19:06:59 +05:30
coding_context.py
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 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
context_engine.py
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): copy-on-write in image-shrink recovery so degraded images never reach stored history 2026-07-28 20:04:58 +05:30
conversation_loop.py perf(state): apply per-call token accounting on a background single-writer queue 2026-07-28 18:47:54 +05:30
copilot_acp_client.py
credential_persistence.py
credential_pool.py
credential_sources.py
credits_tracker.py
curator.py
curator_backup.py
delegation_context.py
display.py
error_classifier.py fix(errors): log when the empty-stub guard and malformed-body classification fire 2026-07-27 20:27:56 -07:00
errors.py
file_safety.py
gemini_native_adapter.py fix(gemini): explain legacy Standard-key 401 rejections with migration guidance 2026-07-26 20:58:57 -07:00
gemini_schema.py fix(gemini): preserve typed enum constraints as strings 2026-07-26 20:59:16 -07:00
i18n.py
image_gen_provider.py
image_gen_registry.py
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
learning_mutations.py
lmstudio_reasoning.py
manual_compression_feedback.py
markdown_tables.py
memory_manager.py
memory_provider.py
message_content.py
message_sanitization.py
moa_loop.py refactor(moa): co-locate guidance peel with attach, add round-trip contract 2026-07-28 01:10:05 +05:30
moa_trace.py
model_metadata.py
models_dev.py
moonshot_schema.py
nous_rate_guard.py
onboarding.py
oneshot.py
plugin_llm.py
portal_tags.py
process_bootstrap.py
prompt_builder.py
prompt_caching.py perf(caching): selective copy instead of deepcopy entire history 2026-07-28 20:04: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 fix(redact): stop masking prose words that embed a secret keyword (Secretary, tokenizer, author=) 2026-07-26 20:59:11 -07:00
replay_cleanup.py
retry_utils.py
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
skill_utils.py fix(skills): parse stored GitHub credentials without scanner false positives 2026-07-26 20:59:26 -07:00
ssl_guard.py
ssl_verify.py
stream_diag.py
stream_single_writer.py
subagent_lifecycle.py fix(delegation): integrate lifecycle refactor with tool-history + daemon pool 2026-07-26 23:27:30 -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 fix(sessions): stop titling a session after the skill it invoked 2026-07-26 02:58:16 -05:00
tool_dispatch_helpers.py
tool_executor.py Revert "feat(observability): integrate NeMo Relay runtime and shared metrics" 2026-07-27 22:28:08 -04: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
trajectory.py
transcription_provider.py
transcription_registry.py
tts_provider.py
tts_registry.py
turn_context.py fix(agent): type a synthesized user turn when its row is written 2026-07-28 03:54:16 -05:00
turn_finalizer.py Revert "feat(observability): integrate NeMo Relay runtime and shared metrics" 2026-07-27 22:28:08 -04:00
turn_retry_state.py
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
verification_evidence.py
verification_stop.py
verify_hooks.py
vertex_adapter.py
video_gen_provider.py
video_gen_registry.py
web_search_provider.py
web_search_registry.py