hermes-agent/agent
kshitijk4poor b23e1c3077 refactor(approval): extract is_approval_bypass_active(); use frozen-env bypass in codex routing
Self-review follow-up on the salvaged approval-routing fix.

The initial adaptation re-read os.getenv("HERMES_YOLO_MODE") at session-build
time. That diverges from the repo's security invariant: HERMES_YOLO_MODE is
frozen into tools.approval._YOLO_MODE_FROZEN at import time precisely so a skill
running mid-process cannot set the env var and instantly flip the approval
bypass (a prompt-injection escalation path). A live re-read re-opened that hole
for the codex routing path.

- Add tools.approval.is_approval_bypass_active() — the canonical three-source
  bypass check (frozen --yolo/HERMES_YOLO_MODE + session /yolo + approvals.mode
  off) in one place. This is the 4th inline copy of that OR-chain (the three
  sites in approval.py and tui_gateway/server.py:3121 all use the same idiom);
  the helper is the shared chokepoint they can collapse onto.
- codex_runtime.py now calls is_approval_bypass_active() instead of the
  hand-rolled mode-or-session check plus a runtime env re-read.
- Update the env-yolo test to patch _YOLO_MODE_FROZEN (the canonical test
  pattern, e.g. tests/tools/test_yolo_mode.py) rather than setenv, which is
  dead-on-arrival against the frozen constant.

Fail-closed default preserved on every branch; 28 integration + 77 session/yolo
tests pass; E2E confirms the real exec decision flips decline->accept only when
bypass is active.
2026-07-01 22:58:37 +05:30
..
lsp fix(tui): prevent killpg suicide during MCP shutdown 2026-07-01 04:54:46 -07:00
pet
secret_sources
transports
__init__.py
account_usage.py
agent_init.py
agent_runtime_helpers.py
anthropic_adapter.py
async_utils.py
auxiliary_client.py fix(moa): raise aux timeouts to 900s and give the Codex aux path a stable prompt_cache_key (#56395) 2026-07-01 06:02:40 -07:00
azure_identity_adapter.py
background_review.py
bedrock_adapter.py
billing_view.py
browser_provider.py
browser_registry.py
chat_completion_helpers.py fix: make Nous Portal access token resolution resilient 2026-07-01 05:06:00 -07:00
codex_responses_adapter.py
codex_runtime.py refactor(approval): extract is_approval_bypass_active(); use frozen-env bypass in codex routing 2026-07-01 22:58:37 +05:30
coding_context.py
context_breakdown.py
context_compressor.py fix(compaction): detect and strip merge-into-tail summaries past the delimiter 2026-07-01 18:23:01 +05:30
context_engine.py
context_references.py
conversation_compression.py
conversation_loop.py fix(moa): price aggregator turn at its real model so session cost isn't advisor-only (#56394) 2026-07-01 06:02:33 -07:00
copilot_acp_client.py
credential_persistence.py
credential_pool.py
credential_sources.py
credits_tracker.py
curator.py
curator_backup.py
display.py
error_classifier.py
errors.py
file_safety.py
gemini_native_adapter.py
gemini_schema.py
i18n.py
image_gen_provider.py
image_gen_registry.py
image_routing.py
insights.py
iteration_budget.py
jiter_preload.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 fix(moa): price aggregator turn at its real model so session cost isn't advisor-only (#56394) 2026-07-01 06:02:33 -07:00
moa_trace.py fix(moa): capture streamed aggregator output into full-turn traces (#56312) 2026-07-01 04:07:46 -07:00
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
rate_limit_tracker.py
reasoning_timeouts.py
redact.py
replay_cleanup.py
retry_utils.py
runtime_cwd.py
secret_scope.py
shell_hooks.py
skill_bundles.py
skill_commands.py
skill_preprocessing.py
skill_utils.py
ssl_guard.py
stream_diag.py
subdirectory_hints.py fix(subdirectory_hints): catch RuntimeError from Path.expanduser() 2026-07-01 04:55:15 -07:00
system_prompt.py
think_scrubber.py
thinking_timeout_guidance.py
thread_scoped_output.py
title_generator.py fix(title_generator): strip think blocks from LLM output before extracting title 2026-07-01 04:18:48 -07:00
tool_dispatch_helpers.py
tool_executor.py
tool_guardrails.py
tool_result_classification.py
trajectory.py
transcription_provider.py
transcription_registry.py
tts_provider.py
tts_registry.py
turn_context.py
turn_finalizer.py
turn_retry_state.py feat(vertex): add Google Vertex AI provider for Gemini (OAuth2) 2026-07-01 05:25:33 -07:00
usage_pricing.py feat(vertex): add Google Vertex AI provider for Gemini (OAuth2) 2026-07-01 05:25:33 -07:00
verification_evidence.py
verification_stop.py
verify_hooks.py
vertex_adapter.py feat(vertex): add Google Vertex AI provider for Gemini (OAuth2) 2026-07-01 05:25:33 -07:00
video_gen_provider.py
video_gen_registry.py
web_search_provider.py
web_search_registry.py