Skip to content

updates for stability and speed - #14

Merged
teknium1 merged 2 commits into
mainfrom
speed-upgrades
Jan 8, 2026
Merged

updates for stability and speed#14
teknium1 merged 2 commits into
mainfrom
speed-upgrades

Conversation

@teknium1

@teknium1 teknium1 commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@teknium1
teknium1 merged commit 21f9e2d into main Jan 8, 2026
@teknium1
teknium1 deleted the speed-upgrades branch January 8, 2026 09:04
@taeyun16

Copy link
Copy Markdown

🔍 자동 분석 결과

이슈 요약

업적/배지 시스템 — 사용자 활동에 배지 부여하여成就感 + 수집 욕구 자극

기술 구현 고려사항

백엔드 (Phoenix/Ash)

  • 배지 템플릿 테이블: badge_templates (category, tier, conditions_json, icon_name)
  • 유저 배지: user_badges (user_id, badge_id, earned_at, display_order)
  • 발급 로직:Ash change — 투표/가챠/연속 이벤트마다 체크
  • 그래프QL: type + query + subscription
  • 등급 산출: Bronze/Silver/Gold/Diamond — 계정 عمر 기준이 아닌 누적 활동량으로

iOS (SwiftUI)

  • 배지 그리드 View: (잠금/해제 상태, 획득 날짜)
  • 새 배지 모달: (효과음 + 햅틱 + 소셜 공유)
  • 카테고리 필터: 투표/수집/연속/가챠/소셜 탭
  • 통계 표시: "12/45 배지 획득 (27%)" progress ring

우선순위 제안

  1. Phase 1: 투표 배지 4종 (첫/100/1000/10000회)
  2. Phase 2: 수집 배지 (도감 시스템 의존 — 고양이 도감 먼저 필요)
  3. Phase 3: 연속 배지 (Streak 시스템과 통합)
  4. Phase 4: 소셜 배지 + 공유 기능

관련existing 코드

  • — 아직 없으면 Streak 모듈의 periodic reward 패턴 참고
  • BadgeIcon은 SF Symbols (, 등) 활용 가능

🤖 HanNyang Auto Resolver

waym0reom3ga added a commit to waym0reom3ga/autolycus-agent that referenced this pull request Apr 9, 2026
Task NousResearch#14: FreeBSD Compatibility Audit (partial completion)

Changes:
- Added FreeBSD to PLATFORM_MAP in agent/skill_utils.py and tools/skills_tool.py
- Created comprehensive audit report documenting FreeBSD compatibility issues
- Identified voice tools as unavailable on FreeBSD (ctranslate2 has no wheels)
- Documented clipboard support gap for FreeBSD
- Verified PTY fallback mechanism works when ptyprocess unavailable

Files modified:
- agent/skill_utils.py: Added "freebsd": "freebsd" to PLATFORM_MAP
- tools/skills_tool.py: Added "freebsd": "freebsd" to _PLATFORM_MAP
- PLANS/task-coordination.md: Updated task status and added completion notes
- PLANS/freebsd-audit.md: Created detailed audit report with findings

Next steps: Apply remaining high-priority fixes (clipboard support, setup script)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
h4x3rotab pushed a commit to Clawdi-AI/hermes-agent that referenced this pull request Apr 10, 2026
h4x3rotab pushed a commit to Clawdi-AI/hermes-agent that referenced this pull request Apr 10, 2026
…on export, pinned sessions, context meter

Ported from ibelick/webclaw PRs NousResearch#24, #10, NousResearch#14, NousResearch#13:
- Command palette (⌘K): search and switch sessions instantly
- Conversation export: download as Markdown, JSON, or Plain Text
- Pinned sessions: pin/unpin from context menu, shown at top of sidebar
- Context meter: token usage ring in chat header with hover details
- Keyboard shortcuts: ⌘K search, ⌘⇧O new session

New UI primitives: autocomplete, command, input, preview-card
Attachment button/preview components (composer already has built-in support)
malaiwah pushed a commit to malaiwah/hermes-agent that referenced this pull request Apr 11, 2026
malaiwah pushed a commit to malaiwah/hermes-agent that referenced this pull request Apr 11, 2026
The upstream merge (PR NousResearch#14) auto-resolved gateway/run.py's 1598-line
diff and silently dropped the entire self-nudge system (~55 lines in
gateway/run.py, ~37 in run_agent.py, ~5 in model_tools.py). This
broke notify_on_complete for background processes — the mechanism that
fires a hidden turn when a background process exits was gone.

Cherry-picked b8737bc ("feat(gateway): add one-shot self nudge tool")
on top of the merged state, resolving 3 conflicts in gateway/run.py
(media_message_callback + self_nudge_callback coexistence) and 1 in
tests/test_model_tools.py (kept both clarify + self_nudge tests).

The self-nudge system provides:
- _arm_self_nudge / _cancel_self_nudge / _fire_self_nudge in gateway
- self_nudge_callback on AIAgent for tool-initiated delayed turns
- self_nudge tool exposed on gateway platforms (not CLI)
- _pending_hidden_turns for injecting hidden messages on next turn
- Wired to notify_on_complete in terminal_tool.py via
  process_registry.pending_watchers
@a-canary

Copy link
Copy Markdown

Resolution: Setup Complete — Verification Blocked by Issue #11

All setup tasks are complete:

  • ✅ Trading skills present at ~/pi-director/.claude/skills/ (trade-news, trade-cycle, trade-rebalance)
  • ✅ Trading crontab active at instances/trading/crontab
  • ✅ Chutes API key valid (cpk_ format, Issue Support passing morph snapshot id #2 closed)

Remaining: Full end-to-end verification of cron firing and Discord output routing. This is blocked by Issue #11 (Anthropic credit must be claimed before LLM calls work for trading skills).

Closing this issue — setup is done. Verification will happen automatically once Issue #11 is resolved. No further action needed on this issue.

swswordholy-tech added a commit to swswordholy-tech/hermes-agent that referenced this pull request Apr 16, 2026
…EADME, AGENTS, website

Completes the remaining ADDING_A_PLATFORM.md integration points after
the MVP vertical slice (ff70b47..3babac1). Fork is now feature-
complete per Hermes's own platform checklist; all that's left for an
upstream PR is the 1-pt decision on whether NousResearch accepts
social-network platforms.

Integration points added:
  - cron/scheduler.py  — `"agentchat": Platform.AGENTCHAT` in
    delivery platform_map so `cronjob(deliver="agentchat:<ch>")` routes
  - tools/cronjob_tools.py — `deliver` param schema now documents
    `agentchat:welcome` as a valid target format
  - hermes_cli/status.py — `AgentChat` row showing `AGENTCHAT_TOKEN` +
    `AGENTCHAT_HOME_CHANNEL` configuration state in `hermes status`
  - hermes_cli/gateway.py — setup wizard `_PLATFORMS` entry with
    interactive prompts for TOKEN / AGENT_ID / ALLOWED_USERS /
    HOME_CHANNEL / REQUIRE_MENTION / WS_URL (`hermes setup gateway`
    → pick AgentChat)

Docs added / updated:
  - website/docs/user-guide/messaging/agentchat.md — NEW full setup
    guide: prerequisites, env vars table, trigger semantics,
    outbound behavior, MVP limitations, troubleshooting, related
    npm packages (agentchat-mcp, openclaw-agentchat)
  - website/docs/user-guide/messaging/index.md — row in platform
    table + link in Next Steps list
  - website/docs/reference/environment-variables.md — 8 new
    AGENTCHAT_* variable rows
  - README.md — AgentChat added to Messaging Gateway platform list
  - AGENTS.md — `gateway/platforms/` listing updated

channel_directory.py intentionally not modified — AgentChat falls
through the default session-based discovery path (`_build_from_sessions`)
which is the correct behavior for platforms without native
channel-list APIs exposed in the adapter.

redact.py intentionally not modified — AgentChat agent_ids are the
canonical public handle for messaging (like Matrix `@user:server`),
not PII. No regex-level redaction needed.

Verified:
  - 20 unit tests still pass (0.84s)
  - All 4 modified .py files pass `ast.parse`
  - Real-world roundtrip previously verified (sha:3babac1 commit msg)

Fork state after this commit: 9 of 16 ADDING_A_PLATFORM.md points
covered directly, 3 (NousResearch#11 channel_directory, NousResearch#14 redact, NousResearch#16 integration
tests) intentionally skipped with justification, 20 unit tests cover
the 5 core boundary invariants.
@Jack04Fireball

Copy link
Copy Markdown

Heartbeat-Gestartet um 02:00 - Delegiere an Claude Code Subagent fuer AppViewModel Refactoring (ScanVM, LibraryVM, SyncVM, MetadataVM). Aufwand ~4-6h.

@alt-glitch alt-glitch added type/perf Performance improvement or optimization comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint tool/web Web search and extraction labels Apr 22, 2026
fwsmaestro pushed a commit to faworkshop/hermes-agent that referenced this pull request Apr 22, 2026
PM had no GitHub tools — claimed PR NousResearch#14 merged to develop but it
merged to main. Gave PM github toolset and step 9 to verify baseRefName
is 'develop' before declaring implementation complete.
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
@hutchutchutch

Copy link
Copy Markdown

Refactor progress update for issue #14.

Commit: 6124f6e96 refactor(gateway): move proxy runtime

What changed:

  • Added gateway/runtime_proxy.py for proxy-mode agent execution via remote Hermes API server: request construction, streaming setup, SSE parsing, typing indicators, stale-generation discard, and result shape normalization.
  • Kept GatewayRunner._get_proxy_url() and _run_agent_via_proxy() as compatibility wrappers.
  • gateway/run.py is now 9,822 lines; gateway/runtime_proxy.py is 291 lines and remains below the ~500-line target.

Validation:

  • /Users/home/.hermes/hermes-agent/venv/bin/python -m py_compile gateway/run.py gateway/runtime_proxy.py
  • /Users/home/.hermes/hermes-agent/venv/bin/python -m pytest tests/gateway/test_proxy_mode.py -q (22 passed)
  • standard batch 1: tests/gateway/test_replay_entry_fields.py tests/gateway/test_media_extraction.py tests/gateway/test_stt_config.py tests/gateway/test_restart_resume_pending.py tests/hermes_cli/test_commands.py -q (265 passed)
  • standard batch 2: tests/gateway/test_loop_exception_handler.py tests/gateway/test_gateway_silence_tokens.py tests/gateway/test_display_config.py tests/gateway/test_gateway_command_help.py tests/gateway/test_status_command.py tests/gateway/test_runtime_footer.py tests/gateway/test_session_info.py -q (115 passed)
  • git diff --check

@hutchutchutch

Copy link
Copy Markdown

Refactor progress update for issue #14.

Commit: 6ebe9eaa7 refactor(gateway): move telegram topic rename runtime

What changed:

  • Moved Telegram DM topic auto-title rename behavior into gateway/runtime_telegram_topics.py.
  • Kept GatewayRunner._rename_telegram_topic_for_session_title() as a compatibility wrapper; the scheduler remains in run.py because runtime_telegram_topics.py is now near the ~500-line cap.
  • gateway/run.py is now 9,752 lines; gateway/runtime_telegram_topics.py is 495 lines and remains below the ~500-line target.

Validation:

  • /Users/home/.hermes/hermes-agent/venv/bin/python -m py_compile gateway/run.py gateway/runtime_telegram_topics.py
  • /Users/home/.hermes/hermes-agent/venv/bin/python -m pytest tests/gateway/test_telegram_topic_mode.py -q (44 passed)
  • standard batch 1: tests/gateway/test_replay_entry_fields.py tests/gateway/test_media_extraction.py tests/gateway/test_stt_config.py tests/gateway/test_restart_resume_pending.py tests/hermes_cli/test_commands.py -q (265 passed)
  • standard batch 2: tests/gateway/test_loop_exception_handler.py tests/gateway/test_gateway_silence_tokens.py tests/gateway/test_display_config.py tests/gateway/test_gateway_command_help.py tests/gateway/test_status_command.py tests/gateway/test_runtime_footer.py tests/gateway/test_session_info.py -q (115 passed)
  • git diff --check

@hutchutchutch

Copy link
Copy Markdown

Refactor progress update for issue #14.

Commit: 2d6820e6e refactor(gateway): move pending transcription runtime

What changed:

  • Moved queued pending-message transcription handling into gateway/runtime_inbound.py alongside fresh inbound media/STT preprocessing.
  • Kept GatewayRunner._dequeue_pending_with_transcription() as a compatibility wrapper.
  • gateway/run.py is now 9,717 lines; gateway/runtime_inbound.py is 306 lines and remains below the ~500-line target.

Validation:

  • /Users/home/.hermes/hermes-agent/venv/bin/python -m py_compile gateway/run.py gateway/runtime_inbound.py
  • /Users/home/.hermes/hermes-agent/venv/bin/python -m pytest tests/gateway/test_stt_config.py tests/gateway/test_telegram_audio_vs_voice.py tests/gateway/test_queue_consumption.py tests/gateway/test_run_progress_interrupt.py -q (28 passed)
  • standard batch 1: tests/gateway/test_replay_entry_fields.py tests/gateway/test_media_extraction.py tests/gateway/test_stt_config.py tests/gateway/test_restart_resume_pending.py tests/hermes_cli/test_commands.py -q (265 passed)
  • standard batch 2: tests/gateway/test_loop_exception_handler.py tests/gateway/test_gateway_silence_tokens.py tests/gateway/test_display_config.py tests/gateway/test_gateway_command_help.py tests/gateway/test_status_command.py tests/gateway/test_runtime_footer.py tests/gateway/test_session_info.py -q (115 passed)
  • git diff --check

@hutchutchutch

Copy link
Copy Markdown

Refactor progress update: extracted Telegram topic action behavior from gateway/run.py into new gateway/runtime_telegram_topic_actions.py while keeping the existing GatewayRunner wrapper methods intact for callers/tests.\n\nMoved implementations for topic capability checks, System topic creation/pinning, setup image delivery, title rename scheduling, topic-mode disable, and topic session restore. This avoids adding more code to the already-full runtime_telegram_topics.py state/routing module and keeps the new action module at 264 LOC.\n\nValidation:\n- python -m py_compile gateway/run.py gateway/runtime_telegram_topic_actions.py\n- pytest tests/gateway/test_telegram_topic_mode.py -q -> 44 passed\n- pytest tests/gateway/test_telegram_thread_fallback.py tests/gateway/test_restart_notification.py -q -> 73 passed\n- standard gateway batch 1 -> 265 passed\n- standard gateway batch 2 -> 115 passed\n- git diff --check\n\nLine counts after this slice:\n- gateway/run.py: 9540\n- gateway/runtime_telegram_topic_actions.py: 264\n- gateway/runtime_telegram_topics.py: 495

@hutchutchutch

Copy link
Copy Markdown

Refactor progress update: extracted the early inbound control-plane interceptors from GatewayRunner._handle_message into new gateway/runtime_inbound_control.py.\n\nMoved the pre-gateway-dispatch plugin hook, pending update-prompt replies, pending clarify replies, and slash-confirm reply interception behind two small helper interfaces while preserving the existing runner control flow. Kept runtime_inbound.py focused on inbound media/text preparation so it remains under the target size.\n\nValidation:\n- python -m py_compile gateway/run.py gateway/runtime_inbound.py gateway/runtime_inbound_control.py\n- pytest tests/gateway/test_pre_gateway_dispatch.py tests/gateway/test_destructive_slash_confirm.py tests/gateway/test_update_streaming.py tests/tools/test_slash_confirm.py -q -> 48 passed\n- standard gateway batch 1 -> 265 passed\n- standard gateway batch 2 -> 115 passed\n- git diff --check\n\nLine counts after this slice:\n- gateway/run.py: 9368\n- gateway/runtime_inbound.py: 306\n- gateway/runtime_inbound_control.py: 234

@hutchutchutch

Copy link
Copy Markdown

Refactor progress update: extracted the active-session ingress fast path from GatewayRunner._handle_message into new gateway/runtime_active_session.py.\n\nMoved stale running-agent eviction, mid-run slash command handling, /queue and /steer routing, Telegram/photo follow-up queuing, pending-sentinel handling, drain handling, queue/steer busy modes, subagent-protection demotion, and default interrupt behavior behind a single handle_running_session_ingress(...) interface. Existing GatewayRunner methods remain the call surface for command handlers and state mutation.\n\nValidation:\n- python -m py_compile gateway/run.py gateway/runtime_active_session.py\n- focused active-session ingress suite -> 114 passed\n- standard gateway batch 1 -> 265 passed\n- standard gateway batch 2 -> 115 passed\n- git diff --check\n\nLine counts after this slice:\n- gateway/run.py: 8986\n- gateway/runtime_active_session.py: 472\n- gateway/runtime_busy.py: 226

@hutchutchutch

Copy link
Copy Markdown

Refactor progress update: extracted plugin/bundle/skill slash-command dispatch from GatewayRunner._handle_message into gateway/runtime_skills.py.\n\nMoved plugin command lookup, skill bundle rewriting, individual skill command rewriting, per-platform disabled-skill checks, unavailable-skill hints, and unknown slash-command fallback behind handle_plugin_bundle_or_skill_command(...). Kept gateway.run._check_unavailable_skill as the compatibility wrapper for existing tests/imports.\n\nValidation:\n- python -m py_compile gateway/run.py gateway/runtime_skills.py\n- focused skill/bundle command suite -> 211 passed\n- standard gateway batch 1 -> 265 passed\n- standard gateway batch 2 -> 115 passed\n- git diff --check\n\nLine counts after this slice:\n- gateway/run.py: 8894\n- gateway/runtime_skills.py: 344

@hutchutchutch

Copy link
Copy Markdown

Refactor progress update: extracted cold-path built-in slash command dispatch from GatewayRunner._handle_message into new gateway/runtime_command_dispatch.py.\n\nMoved the built-in branch table, destructive /new and /undo confirmation wrappers, /blueprint seed rewrite/ack behavior, and inactive /steer payload rewrite behind handle_builtin_command(...). Fall-through behavior is preserved for commands that intentionally rewrite event.text and continue into the agent path.\n\nValidation:\n- python -m py_compile gateway/run.py gateway/runtime_command_dispatch.py\n- focused command/dispatch suite -> 97 passed\n- standard gateway batch 1 -> 265 passed\n- standard gateway batch 2 -> 115 passed\n- git diff --check\n\nLine counts after this slice:\n- gateway/run.py: 8687\n- gateway/runtime_command_dispatch.py: 163

@hutchutchutch

Copy link
Copy Markdown

Refactor progress update: extracted user-defined quick command handling from GatewayRunner._handle_message into gateway/runtime_command_dispatch.py.\n\nMoved quick-command exec handling, environment sanitization, output redaction, timeout/error messages, and alias rewrite behavior behind handle_quick_command(...). The helper returns the rewritten command name so downstream plugin/skill dispatch keeps the same alias semantics.\n\nValidation:\n- python -m py_compile gateway/run.py gateway/runtime_command_dispatch.py\n- focused quick-command/config/update suite -> 103 passed (same existing resource warning on the timeout path)\n- standard gateway batch 1 -> 265 passed\n- standard gateway batch 2 -> 115 passed\n- git diff --check\n\nLine counts after this slice:\n- gateway/run.py: 8644\n- gateway/runtime_command_dispatch.py: 237

@hutchutchutch

Copy link
Copy Markdown

Command prelude extraction committed as 4999fa0de.

Moved the remaining slash-command prelude out of GatewayRunner._handle_message into gateway/runtime_command_dispatch.py:

  • quick alias expansion before built-in dispatch
  • slash command access checks
  • command:<canonical> hook dispatch including deny/handled/rewrite decisions

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_command_dispatch.py
  • focused command prelude suite: 65 passed, 1 existing quick-command timeout resource warning
  • standard gateway batch 1: 265 passed
  • standard gateway batch 2: 115 passed
  • git diff --check

Line counts after slice:

  • gateway/run.py: 8558
  • gateway/runtime_command_dispatch.py: 378

@hutchutchutch

Copy link
Copy Markdown

Session hygiene extraction committed as 2fc9c6d51.

Moved pre-agent transcript hygiene/compression out of GatewayRunner._handle_message_with_agent into gateway/runtime_session_hygiene.py behind apply_session_hygiene(...). The runner now delegates config/model/context-length resolution, hard-limit checks, compression execution, session-id rotation, transcript rewrite, and user-visible compression warnings to that module while preserving the existing owner/config-loader seams.

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_session_hygiene.py
  • focused hygiene/compression suite: 31 passed
  • standard gateway batch 1: 265 passed
  • standard gateway batch 2: 115 passed
  • git diff --check

Line counts after slice:

  • gateway/run.py: 8253
  • gateway/runtime_session_hygiene.py: 287

@hutchutchutch

Copy link
Copy Markdown

Session preparation extraction committed as 536ab882d.

Moved pre-agent session setup out of GatewayRunner._handle_message_with_agent into gateway/runtime_session_prepare.py behind prepare_agent_session(...):

  • Telegram topic thread recovery and binding heal/sync
  • session:start hook emission and fresh-reset flag consumption
  • auto-reset context/user notice handling
  • context prompt construction with privacy redaction
  • topic/channel auto-skill injection

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_session_prepare.py
  • focused session/topic/reset suite: 95 passed
  • standard gateway batch 1: 265 passed
  • standard gateway batch 2: 115 passed
  • git diff --check

Line counts after slice:

  • gateway/run.py: 8047
  • gateway/runtime_session_prepare.py: 286
  • gateway/runtime_session_hygiene.py: 287

@hutchutchutch

Copy link
Copy Markdown

Agent input preparation extraction committed as 8390808ad.

Moved final pre-agent input shaping out of GatewayRunner._handle_message_with_agent into gateway/runtime_agent_input.py behind prepare_agent_input(...):

  • first-message onboarding/profile-build prompt injection
  • missing-home-channel notice
  • Discord voice context prompt injection
  • inbound message text preparation delegation
  • message timestamp stripping/rendering and transcript persistence metadata

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_agent_input.py
  • focused input/timestamp/media/onboarding suite: 154 passed
  • standard gateway batch 1: 265 passed
  • standard gateway batch 2: 115 passed
  • git diff --check

Line counts after slice:

  • gateway/run.py: 7939
  • gateway/runtime_agent_input.py: 192

@hutchutchutch

Copy link
Copy Markdown

Post-agent process drain extraction committed as 4db28c54f.

Moved the post-agent:end process watcher setup and watch-event completion drain from GatewayRunner._handle_message_with_agent into gateway/runtime_process.py as drain_post_agent_process_events(...).

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_process.py
  • focused post-run/streaming suite: 57 passed
  • standard gateway batch 1: 265 passed
  • standard gateway batch 2: 115 passed
  • git diff --check

Line counts after slice:

  • gateway/run.py: 7914
  • gateway/runtime_process.py: 385

@hutchutchutch

Copy link
Copy Markdown

Agent response preparation extraction committed as 65a1f5ce7.

Moved post-agent response normalization/bookkeeping out of GatewayRunner._handle_message_with_agent into gateway/runtime_agent_response.py behind prepare_agent_response(...):

  • intentional-silence detection
  • (empty) sentinel user-facing replacement
  • response-ready logging
  • cached-agent message-count refresh
  • resume-pending/stuck-loop cleanup
  • empty-response normalization and final-response sanitization

Kept the source-inspected compression session-id propagation and compression-exhaustion reset blocks in gateway/run.py.

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_agent_response.py
  • focused response/source-inspection suite: 55 passed
  • standard gateway batch 1: 265 passed
  • standard gateway batch 2: 115 passed
  • git diff --check

Line counts after slice:

  • gateway/run.py: 7867
  • gateway/runtime_agent_response.py: 91

@hutchutchutch

Copy link
Copy Markdown

Agent exception handling extraction committed as c75eaa74e.

Moved the GatewayRunner._handle_message_with_agent exception path into gateway/runtime_agent_errors.py behind handle_agent_exception(...):

  • stop typing on error
  • exception logging
  • crash-resilience user-message persistence without duplicate append
  • provider/status-code user hints for 401/402/429/529/400/500
  • large-session context-window error reply

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_agent_errors.py
  • focused transcript/error-adjacent suite: 22 passed
  • standard gateway batch 1: 265 passed
  • standard gateway batch 2: 115 passed
  • git diff --check

Line counts after slice:

  • gateway/run.py: 7781
  • gateway/runtime_agent_errors.py: 135

@hutchutchutch

Copy link
Copy Markdown

Transcript persistence extraction committed as cf67c127a.

Moved the post-agent transcript append/update rules out of GatewayRunner._handle_message_with_agent into gateway/runtime_transcript_persistence.py behind persist_agent_turn_transcript(...):

Kept the source-inspected compression session-id propagation and compression-exhaustion reset blocks in gateway/run.py.

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_transcript_persistence.py
  • focused transcript/compression guard suite: 35 passed
  • standard gateway batch 1: 265 passed
  • standard gateway batch 2: 115 passed
  • git diff --check

Line counts after slice:

  • gateway/run.py: 7680
  • gateway/runtime_transcript_persistence.py: 151

@hutchutchutch

Copy link
Copy Markdown

Agent delivery finalization extraction committed as 6b8d7eefa.

Moved the final response delivery tail out of GatewayRunner._handle_message_with_agent into gateway/runtime_agent_delivery.py behind finalize_agent_delivery(...):

  • intentional silence suppression after transcript persistence
  • auto voice reply trigger using existing runner methods
  • already-sent streaming media delivery
  • trailing runtime footer send for streamed turns

The source-inspected GatewayRunner._send_voice_reply method remains in gateway/run.py.

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_agent_delivery.py
  • focused delivery/silence/voice/media suite: 253 passed
  • standard gateway batch 1: 265 passed
  • standard gateway batch 2: 115 passed
  • git diff --check

Line counts after slice:

  • gateway/run.py: 7642
  • gateway/runtime_agent_delivery.py: 63

@hutchutchutch

Copy link
Copy Markdown

Agent response decoration extraction committed as f08de7600.

Moved response decoration out of GatewayRunner._handle_message_with_agent into gateway/runtime_agent_response.py behind decorate_agent_response(...):

  • optional reasoning display with Mattermost override behavior preserved
  • reasoning truncation to 15 lines
  • runtime footer construction
  • inline footer append for non-streamed final responses
  • footer line returned for streamed trailing send

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_agent_response.py
  • focused response/footer suite: 106 passed
  • standard gateway batch 1: 265 passed
  • standard gateway batch 2: 115 passed
  • git diff --check

Line counts after slice:

  • gateway/run.py: 7606
  • gateway/runtime_agent_response.py: 165

@hutchutchutch

Copy link
Copy Markdown

Transcript failure classification extraction committed as 939ddfd61.

Moved the context-overflow vs transient-failure transcript classifier out of GatewayRunner._handle_message_with_agent into gateway/runtime_transcript_persistence.py behind classify_agent_failure_for_transcript(...):

  • preserves compression-exhausted/context-keyword/generic-400-on-large-history classification
  • preserves transient-failure logging for retryable provider failures
  • keeps the source-inspected compression-exhaustion reset block in gateway/run.py

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_transcript_persistence.py
  • focused classifier/transcript/compression guard suite: 27 passed
  • standard gateway batch 1: 265 passed
  • standard gateway batch 2: 115 passed
  • git diff --check

Line counts after slice:

  • gateway/run.py: 7571
  • gateway/runtime_transcript_persistence.py: 194

@hutchutchutch

Copy link
Copy Markdown

Agent turn execution extraction committed as e97d83dd5.

Moved the agent execution envelope out of GatewayRunner._handle_message_with_agent into gateway/runtime_agent_turn.py behind run_agent_turn(...):

  • builds and emits agent:start hook context
  • calls GatewayRunner._run_agent with the existing turn arguments
  • stops platform typing after the agent run
  • discards stale-generation results and clears post-delivery callbacks

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_agent_turn.py
  • focused hook/stale/typing suite: 145 passed
  • standard gateway batch 1: 265 passed
  • standard gateway batch 2: 115 passed
  • git diff --check

Line counts after slice:

  • gateway/run.py: 7543
  • gateway/runtime_agent_turn.py: 85

@hutchutchutch

Copy link
Copy Markdown

Refactor slice completed: progress queue draining

Commit: 74c005516 refactor(gateway): move progress queue draining

What moved:

  • Added gateway/runtime_progress.py with send_gateway_progress_messages() for draining tool-progress queues, edit/send fallback, overflow splitting, reset handling, interrupt draining, and cleanup-progress message-id tracking.
  • Kept the local send_progress_messages() wrapper in gateway/run.py so the _run_agent task orchestration and naming stay stable.
  • Left progress policy/callback setup in gateway/run.py; this slice only moves the drain implementation behind a deeper module interface.

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_progress.py
  • pytest tests/gateway/test_run_progress_topics.py tests/gateway/test_run_progress_interrupt.py tests/gateway/test_run_cleanup_progress.py tests/gateway/test_telegram_progress_edit_transient.py -q -> 62 passed
  • pytest tests/gateway/test_stream_consumer.py tests/gateway/test_stream_consumer_fresh_final.py tests/gateway/test_stream_consumer_draft.py -q -> 139 passed
  • standard batch 1 -> 265 passed
  • standard batch 2 -> 115 passed
  • git diff --check

Line counts:

  • gateway/run.py: 7,230
  • gateway/runtime_progress.py: 333
  • nearby extracted helpers remain under 500 lines: runtime_process.py 385, runtime_command_dispatch.py 378, runtime_session_hygiene.py 287, runtime_session_prepare.py 286, runtime_agent_input.py 192.

@hutchutchutch

Copy link
Copy Markdown

Refactor slice completed: streaming/interim setup

Commit: e5c72a14e refactor(gateway): move streaming setup

What moved:

  • Added gateway/runtime_streaming.py with setup_gateway_streaming() and GatewayStreamingSetup.
  • Moved the GatewayStreamConsumer construction, per-platform streaming gate, Matrix cursor suppression, Telegram fresh-final setting, stream delta callback, and interim assistant fallback-send callback out of gateway/run.py.
  • Kept agent callback assignment in gateway/run.py so cached-agent per-turn state remains local to _run_agent.

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_streaming.py
  • pytest tests/gateway/test_run_progress_topics.py tests/gateway/test_compression_failure_session_sync.py tests/gateway/test_stream_consumer_thread_routing.py -q -> 43 passed
  • pytest tests/gateway/test_run_progress_interrupt.py tests/gateway/test_run_cleanup_progress.py tests/gateway/test_stream_consumer.py tests/gateway/test_stream_consumer_fresh_final.py tests/gateway/test_stream_consumer_draft.py -q -> 146 passed
  • standard batch 1 -> 265 passed
  • standard batch 2 -> 115 passed
  • git diff --check

Line counts:

  • gateway/run.py: 7,149
  • gateway/runtime_streaming.py: 152
  • gateway/runtime_progress.py: 333
  • gateway/runtime_process.py: 385
  • gateway/runtime_command_dispatch.py: 378

@hutchutchutch

Copy link
Copy Markdown

Refactor slice completed: agent notification callbacks

Commit: 4e5acccf9 refactor(gateway): move agent notification callbacks

What moved:

  • Added gateway/runtime_agent_callbacks.py for per-turn notice and background-review callback wiring.
  • Moved account/usage notice delivery callback setup and deferred background-review notification release logic out of gateway/run.py.
  • Preserved gateway.run.render_notice_line as an import/re-export because tests and callers still import that symbol from gateway.run.

Validation:

  • python -m py_compile gateway/run.py gateway/runtime_agent_callbacks.py
  • pytest tests/gateway/test_run_progress_topics.py tests/gateway/test_notice_rendering.py tests/gateway/test_agent_cache.py -q -> 110 passed
  • standard batch 1 -> 265 passed
  • standard batch 2 -> 115 passed
  • git diff --check

Line counts:

  • gateway/run.py: 7,091
  • gateway/runtime_agent_callbacks.py: 114
  • gateway/runtime_streaming.py: 152
  • gateway/runtime_progress.py: 333

@9thLevelSoftware

Copy link
Copy Markdown

Post-Merge Review Summary

PR: #14 — "updates for stability and speed"
Status: Merged on 2026-01-08 (merge commit 21f9e2d)
Author: @teknium1
Changes: 5 files, +448/-131 lines

What This PR Does

  1. batch_runner.py — Adds OpenRouter provider preference parameters (providers_allowed, providers_ignored, providers_order, provider_sort) and a log_prefix for parallel worker identification. Adds progress print statements.

  2. run_agent.py — Adds log_prefix support for all log messages, OpenRouter provider preferences via extra_body, enhanced error logging (error type, elapsed time, request context), increased API timeout (300s to 600s), better API key fallback logic based on base_url, masked API key display for debugging, more aggressive suppression of openai/httpx/httpcore library logging, and reasoning content extraction for models that support it (minimax, kimi). Moves api_messages preparation outside the retry loop.

  3. run_datagen_minimax-3.1.sh (new) — Shell script for batch data generation with minimax-m2.1 via OpenRouter.

  4. test_api_call_reasoning.py (new) — Standalone test script for verifying minimax-m2.1 tool-calling via OpenRouter.

  5. tools/web_tools.py — Switches LLM content summarization from Nous Research API to OpenRouter API. Changes default model from gemini-2.5-flash to google/gemini-3-flash-preview. Makes LLM content processing parallel using asyncio.gather (significant performance improvement for multi-URL extraction/crawl).

Test Results

Relevant tests pass (99 total across batch_runner and web_tools test suites):

  • tests/test_batch_runner_checkpoint.py: 16 passed
  • tests/tools/test_web_tools_config.py: 65 passed
  • tests/tools/test_web_extract_robustness.py: 3 passed
  • tests/tools/test_web_tools_truncate.py: 12 passed
  • tests/tools/test_web_tools_dict_urls.py: 3 passed

Review Findings

No blocking issues found. The PR is already merged and the changes are functional.

Minor observations:

  • run_datagen_minimax-3.1.sh is missing a trailing newline (cosmetic)
  • test_api_call_reasoning.py is a standalone test script, not integrated into the pytest suite
  • The API key fallback logic in run_agent.py uses hardcoded provider name matching (e.g. "openrouter" in base_url.lower()) which works but is fragile

P2 Inline Comment (from bot review)

The P2 comment about "double-probing terminal readiness" on tools/code_execution_tool.py line 217 is about code that was NOT changed by this PR — the bot scanned the full repo state at the PR's head commit. A fix for that concern was created in commit 8ddafd3 (branch wt/t_a695688a) which makes check_sandbox_requirements() call check_terminal_requirements(). That fix is pending merge to main.


Reviewed by Hermes Agent (improver profile) on 2026-07-12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint tool/web Web search and extraction type/perf Performance improvement or optimization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants