Skip to content

feat: ACP server + cron timezone fix#949

Merged
teknium1 merged 2 commits intomainfrom
hermes/hermes-b86fddbe
Mar 11, 2026
Merged

feat: ACP server + cron timezone fix#949
teknium1 merged 2 commits intomainfrom
hermes/hermes-b86fddbe

Conversation

@teknium1
Copy link
Contributor

@teknium1 teknium1 commented Mar 11, 2026

Two features in one PR

1. fix(cron): handle naive legacy timestamps in due-job checks

Cherry-picked from PR #807 by @0xNyk with 3 additional regression tests.

2. feat: ACP (Agent Client Protocol) server for editor integration

Based on PR #837 by @teknium1, with complete implementation of the prompt flow.


ACP Implementation (~1200 lines)

Adds full ACP support, enabling hermes-agent to work as a coding agent inside VS Code, Zed, JetBrains IDEs, and any ACP-compatible editor.

User Flow

1. hermes is already installed
2. pip install -e '.[acp]'
3. Install ACP Client extension in VS Code
4. Add to settings: point to acp_registry/ directory
5. Open ACP panel → Select hermes → Start chatting

Architecture (acp_adapter/)

File Lines Purpose
server.py 280 HermesACPAgent — all 15 Agent protocol methods
session.py 120 Thread-safe SessionManager with per-session AIAgent
events.py 170 Callback → ACP notification bridging
tools.py 200 Tool kind mapping (25+ tools) + content builders
permissions.py 80 Approval bridging → editor permission dialogs
auth.py 26 Provider credential detection
entry.py 86 CLI entry point

Key Features

  • Full prompt flow: AIAgent runs in thread executor, streams tool events, thinking, and messages back in real-time
  • Tool events with kinds: read/edit/execute/search/fetch/think mapped for 25+ hermes tools
  • Diff content for file edits (patch, write_file)
  • Permission bridging: dangerous commands → editor approval dialog
  • Session lifecycle: new, load, resume, list, fork, cancel
  • Model switching support
  • No modifications to run_agent.py — works entirely through existing callback system

Also includes

  • jupyter-live-kernel skill for data science workflows
  • acp_registry/ with agent.json for editor auto-discovery
  • docs/acp-setup.md setup guide (VS Code, Zed, JetBrains)
  • hermes acp CLI subcommand

What was fixed from the original PR #837

  • Fixed broken imports in events.py (4 of 5 imported names didn't exist)
  • Implemented prompt() (was a placeholder returning empty response)
  • Made all Agent methods async (ACP SDK requires it)
  • Added load_session/resume_session support
  • Removed dead _acp_tool_bridge hook from run_agent.py
  • Expanded TOOL_KIND_MAP from 7 to 25+ tools
  • Added make_tool_call_id and build_tool_title functions
  • Added result truncation for large tool outputs
  • Added events.py tests (were completely missing)

Tests

  • 81 new ACP tests + 3 cron timezone regression tests
  • Full suite: 3330 passed, 16 skipped (2 pre-existing unrelated failures)

Fixes #806
Closes #807
Closes #837

Co-authored-by: 0xNyk 0xNyk@users.noreply.github.com

0xNyk and others added 2 commits March 11, 2026 08:38
Legacy cron job rows may store next_run_at without timezone info.
_ensure_aware() previously stamped the Hermes-configured tz directly
via replace(tzinfo=...), which shifts absolute time when system-local
tz differs from Hermes tz — causing overdue jobs to appear not due.

Now: naive datetimes are interpreted as system-local wall time first,
then converted to Hermes tz. Aware datetimes are normalized to Hermes
tz for consistency.

Cherry-picked from PR #807, rebased onto current main.
Fixes #806

Co-authored-by: 0xNyk <0xNyk@users.noreply.github.com>
Three new tests for the naive timestamp fix (PR #807):
- test_ensure_aware_naive_preserves_absolute_time: verifies UTC equivalent
  is preserved when interpreting naive datetimes as system-local time
- test_ensure_aware_normalizes_aware_to_hermes_tz: verifies already-aware
  datetimes are normalized to Hermes tz without shifting the instant
- test_ensure_aware_due_job_not_skipped_when_system_ahead: end-to-end
  regression test for the original bug scenario
@teknium1 teknium1 merged commit fa7a18f into main Mar 11, 2026
1 check passed
@teknium1 teknium1 changed the title fix(cron): handle naive legacy timestamps in due-job checks feat: ACP server + cron timezone fix Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: get_due_jobs may skip legacy naive timestamps under non-local Hermes timezone

2 participants