hermes - ✅(Solved) Fix [Feature]: Stamp originating session_id on kanban tasks created during ACP sessions [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#23199Fetched 2026-05-11 03:30:36
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×1

Fix Action

Fixed

PR fix notes

PR #23208: feat(kanban): stamp originating ACP session_id on tasks

Description (problem / solution / changelog)

Closes #23199.

Summary

Track which chat session created a kanban task so clients can render a per-session board without falling back to tenant + time-window heuristics.

What changed

  • Schematasks gains a nullable session_id TEXT column with an index. Migration follows the existing _migrate_add_optional_columns pattern (the max_retries precedent), so legacy DBs upgrade in place on the next init_db call.
  • ACP propagationacp_adapter/server.py exposes the originating session id to the agent loop via HERMES_SESSION_ID, mirroring the existing save/set/restore lifecycle around HERMES_INTERACTIVE. Restoring is important so a re-used executor thread doesn't leak one session's id into the next session's tools.
  • Tooltools/kanban_tools.py _handle_create reads HERMES_SESSION_ID (with an explicit session_id arg override) and passes it to kb.create_task, parallel to the existing HERMES_TENANT fallback. NULL on CLI/dashboard paths so behaviour is unchanged for non-ACP callers.
  • CLIhermes kanban list accepts --session <id>. JSON output now includes session_id. The flag ANDs with existing --tenant / --assignee filters.

Testing

  • 8 new tests across the kanban DB, tools, CLI, and ACP server suites:
    • kanban_db stamping + filtering, including a tenant×session compose case.
    • kanban_create env propagation, explicit-arg override, and absent-env defaults-to-NULL.
    • CLI --session filter + JSON output exposes session_id.
    • ACP _run_agent sets HERMES_SESSION_ID during the call and restores the prior value (covers the nested-loop case so an outer HERMES_SESSION_ID survives an inner prompt).
  • Existing kanban + ACP suites unchanged: 402 passing locally (tests/hermes_cli/test_kanban_*.py, tests/tools/test_kanban_tools.py, tests/acp/, tests/acp_adapter/).
  • The pre-existing concurrency-migration test (test_migrate_add_optional_columns_tolerates_concurrent_migration) had its already-migrated schema fixture extended to include the new column, so the "migration is no-op when columns exist" guarantee still covers session_id.

Backwards compatibility

  • Legacy DBs migrate in place; existing rows get session_id = NULL, which is the correct default.
  • Non-ACP creation paths (CLI, dashboard, legacy hosts that don't set the env) continue to produce session_id = NULL rows. The CLI and JSON shape changes are additive — no flag is removed, no JSON key is renamed.
  • The HERMES_SESSION_ID env var is only read on the kanban-create code path; if a client wants to opt their tools out, simply not setting the env produces today's behaviour.

Use case (downstream)

We're building Scarf, a macOS GUI for Hermes. While a user has a /goal running, we want to show a Kanban board scoped to "tasks this chat is producing." Without session linkage we have to approximate via tenant + time-window — which over-collects for concurrent chats on the same project and under-collects for chats with no tenant. With this PR landed, Scarf can pass --session <acp-session-id> for a precise filter.

🤖 Generated with Claude Code

Changed files

  • acp_adapter/server.py (modified, +14/-1)
  • hermes_cli/kanban.py (modified, +5/-0)
  • hermes_cli/kanban_db.py (modified, +40/-3)
  • tests/acp/test_server.py (modified, +74/-0)
  • tests/hermes_cli/test_kanban_cli.py (modified, +42/-0)
  • tests/hermes_cli/test_kanban_db.py (modified, +72/-1)
  • tests/tools/test_kanban_tools.py (modified, +69/-0)
  • tools/kanban_tools.py (modified, +5/-0)
RAW_BUFFERClick to expand / collapse

Problem or Use Case

Use case

Building Scarf, a macOS GUI for Hermes. We want to show a per-chat Kanban view: while a user has a /goal running, they can open a board scoped to "tasks this chat is producing."

What's missing

There's no wire-level link between an ACP chat session and the kanban tasks it creates:

  • tasks table has no session_id / acp_session_id column.
  • kanban_create stamps created_by = HERMES_PROFILE but no session id.
  • hermes kanban list accepts --mine / --assignee / --status / --tenant / --archived — no --session.
  • ACP doesn't propagate a session-id env into the agent loop, so even adding a column wouldn't auto-populate without a tool-side change.

The closest available scope is tenant, which is per-project. That breaks down for multiple concurrent chats in the same project, chats with no project (tenant NULL), and distinguishing tasks from different goal-runs in the same chat.

Impact

Clients (Scarf and anyone else building UIs over Hermes) can render an honest chat-scoped board. Without it, we're stuck with tenant + a client-side created_at >= heuristic that imprecisely overlaps with other concurrent agents on the same tenant.

Related context (not part of this ask)

The kanban toolset is currently gated on HERMES_KANBAN_TASK (worker spawn) OR kanban in the profile's toolsets. The default platform_toolsets.cli doesn't include kanban, so a user running /goal … in hermes acp has zero kanban tools in their function schema — the agent can't decompose into kanban tasks even if it wanted to. Scarf will surface that gating in its own UI; just flagging it here for context, since session linkage only becomes useful once chat-driven creation is happening.

Happy to send a PR if there's interest in the shape.

Proposed Solution

Proposed minimal change

  1. Add session_id TEXT to tasks with an index. Backwards compatible (NULL on existing rows and non-ACP-driven rows).
  2. Expose the originating session id to kanban tools when a call comes from an ACP session — HERMES_SESSION_ID env is the natural shape (same pattern as HERMES_KANBAN_TASK).
  3. kanban_create reads HERMES_SESSION_ID and stamps it on the new task.
  4. hermes kanban list accepts --session <id>.
  5. kanban show --json and kanban watch --json include session_id in the output.

Alternatives Considered

No response

Feature Type

New tool

Scope

None

Contribution

  • I'd like to implement this myself and submit a PR

Debug Report (optional)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Feature]: Stamp originating session_id on kanban tasks created during ACP sessions [1 pull requests, 1 participants]