Skip to content

fix: gap3/gaps session-delete hardening + workspace command (local work) - #5

Merged
adm01-debug merged 3 commits into
mainfrom
feat/hermes-h290292-local-gap-workspace
Aug 9, 2026
Merged

fix: gap3/gaps session-delete hardening + workspace command (local work)#5
adm01-debug merged 3 commits into
mainfrom
feat/hermes-h290292-local-gap-workspace

Conversation

@adm01-debug

@adm01-debug adm01-debug commented Aug 9, 2026

Copy link
Copy Markdown
Owner

O que é

Trabalho local rodando no install (branch feat/coding-brain-upgrades) que nunca foi publicado no fork — sem este PR, o próximo sync pode perdê-lo. Cherry-pick limpo dos 3 commits de campanha sobre main (PR #1 já tem o purge de routing; estes são a evolução).

Commits

  1. fix(gap3): SessionStore.forget_sessions + backstop multi-processo (_prune_dead_persisted_entries) + wiring no api_server — sessão deletada por outro processo nunca ressuscita no próximo save do gateway
  2. fix(gaps): N1 token accounting não ressuscita sessão deletada; N3/N5 cleanup de async delegations + delivery obligations no delete; N4 retry com colisão de id + warning upsert; N8/N9 defensivos; suíte de testes
  3. feat(workspace): comando /workspace (port PR feat(workspace): add /workspace command for per-topic prompts, skills, and models NousResearch/hermes-agent#30968 + fixes de review) — workspaces por pasta (SYSTEM.md + topics.yaml), prompt/skills/model por tópico, sobrevive a /new

Arquivos principais

  • gateway/session.py — forget_sessions + backstop + _query_existing_session_ids (chunk 500)
  • gateway/platforms/api_server.py — sessions_dir dinâmico do SessionStore + forget após delete
  • hermes_state.py — N3/N5 cleanup no-FK side tables, N1 anti-ressurreição
  • agent/workspace_resolver.py (novo), gateway/run.py, gateway/config.py, agent/skill_utils.py
  • 8 arquivos de teste novos/atualizados

Verificação

  • 67/67 testes passando (suíte de campanha + workspace + lock_io)
  • Compilação: todos os arquivos .py do repo sem erro
  • Simulações validadas no install: delete 4 camadas, backstop multi-processo (entry morta removida, zero ressuscitação), degradação graciosa com DB falho, cascade de delegates, prioridade /model > workspace > config
  • Revisão Claude Code: APROVADO
  • Correções de teste pré-existentes incluídas: mock _read_ctx fiel (lock_io), _HOME_ENV nos testes feishu (Windows)

31 arquivos, +9100/-328.


Summary by cubic

Hardens multi‑process session deletion so deleted sessions never resurrect, and adds folder‑based workspaces with a /workspace command for per‑topic prompts, skills, and model overrides that survive /new.

  • Bug Fixes

    • Added SessionStore.forget_sessions() and wired it into the API delete path; gateway saves now prune dead session entries before persisting to prevent resurrection.
    • Token accounting no longer recreates deleted sessions; deleting a session also cleans up related async delegations and delivery obligations.
    • Session ID collisions are retried on insert; title‑conflict creates purge routing inside the same transaction; added defensive checks to avoid stale routing.
    • Bridged Telegram group_topics/dm_topics from top‑level config into extra for simpler config authoring.
    • Expanded test coverage for backstop/forget logic, deletion side‑tables, Windows‑safe env in tests, and platform adapters.
  • New Features

    • /workspace command (CLI and gateway): create, link/unlink, set model, list, show, remove.
    • Folder‑based workspaces: ~/.hermes/workspaces/<name>/SYSTEM.md (frontmatter + prompt) and per‑chat ~/.hermes/platforms/<platform>/<chat_id>/topics.yaml mapping threads to workspace names.
    • Workspace‑local skills (skills/ under each workspace) are auto‑loaded; lightweight resolver with stat cache.
    • Workspace model override applies automatically (priority: /model > workspace > config); includes Telegram interactive picker.

Written for commit 6b425e0. Summary will update on new commits.

Review in cubic

…cleanup delegations+obligations no delete; N4 retry colisao id + warning upsert; N8/N9 defensivos; testes + correcoes suite gateway (2026-08-08)
 port + review fixes)

Folder-based workspaces (workspaces/<name>/SYSTEM.md + platforms/<plat>/<chat>/topics.yaml):
prompt/skills/model per topic, survives /new. Fixes do review: capture state
por user+topic+msg, resolucao compartilhada via SessionSource, path traversal
hardening. CLI + gateway + Telegram picker. 1710/1710 gateway telegram suite.
Copilot AI lite review requested due to automatic review settings August 9, 2026 15:50
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4c881c8d-fe56-46a2-8962-117a1b0f2f11

📥 Commits

Reviewing files that changed from the base of the PR and between 8eef8a9 and 6b425e0.

📒 Files selected for processing (31)
  • agent/agent_init.py
  • agent/conversation_compression.py
  • agent/skill_utils.py
  • agent/workspace_resolver.py
  • cli.py
  • gateway/config.py
  • gateway/platforms/api_server.py
  • gateway/platforms/base.py
  • gateway/run.py
  • gateway/session.py
  • gateway/slash_commands.py
  • hermes_cli/commands.py
  • hermes_cli/web_server.py
  • hermes_state.py
  • hermes_state_schema.py
  • plugins/platforms/telegram/adapter.py
  • tests/agent/test_workspace_resolver.py
  • tests/gateway/test_config_env_bridge_authority.py
  • tests/gateway/test_discord_liveness.py
  • tests/gateway/test_dm_topics.py
  • tests/gateway/test_email.py
  • tests/gateway/test_feishu.py
  • tests/gateway/test_gap3_forget_verify.py
  • tests/gateway/test_session_reset_notify.py
  • tests/gateway/test_session_store_lock_io.py
  • tests/gateway/test_setup_feishu.py
  • tests/gateway/test_slack_block_kit_adapter.py
  • tests/hermes_state/test_aux_usage_accounting.py
  • tests/test_gap3_round2_n1_n3_n5.py
  • tests/test_gateway_backstop.py
  • tests/test_gateway_forget_sessions.py

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@adm01-debug
adm01-debug merged commit cb5893f into main Aug 9, 2026
26 of 34 checks passed
@adm01-debug
adm01-debug deleted the feat/hermes-h290292-local-gap-workspace branch August 9, 2026 15:50
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.

2 participants