Skip to content

fix(file_state): sibling stale-warning now guides worktree isolation - #86951

Open
albert748 wants to merge 1 commit into
NousResearch:mainfrom
albert748:fix/file-state-sibling-warning-guidance
Open

albert748 wants to merge 1 commit into
NousResearch:mainfrom
albert748:fix/file-state-sibling-warning-guidance

Conversation

@albert748

Copy link
Copy Markdown
Contributor

Context

When concurrent Hermes sessions edit the same git repository, FileStateRegistry.check_stale() warns the model that a sibling subagent modified a file it had read. A real incident (two sessions clobbering each other on the same file) showed the warning alone is not enough: it only says "Re-read the file" — it never tells the model there is an active sibling session, that parallel edits carry clobber risk, or what to do about it.

Change

Both sibling-warning branches in tools/file_state.py::check_stale (Case 1a "sibling wrote, agent never read" and Case 1b "sibling wrote after agent's last read") now append a short collaboration-guidance line:

  • names the risk: concurrent agents may keep editing this repo;
  • gives the escape hatch: isolate in a git worktree (hermes -w / git worktree add) or coordinate with the sibling session.

The added text is intentionally short, generic (no project-specific skill names), and stays warning-only — consistent with the existing "warn, don't block" contract of check_stale.

Relationship to #65605

#65605 (fix: block stale write_file overwrites) is the complementary direction: it makes write_file fail closed on stale baselines by changing tools/file_tools.py and the staleness plumbing. This PR touches only warning text in tools/file_state.py and does not conflict with it — both can land independently; if #65605 lands first, this guidance still improves the surviving warning path.

Tests

  • tests/tools/test_file_state_registry.py: 7 passed (existing sibling assertions still hold, warning text retains sibling + writer id)
  • tests/tools/test_file_staleness.py: 6 passed

用户意图: 08-15 多 Agent 同仓库协作事故后,用户要求遇到兄弟会话并发
          修改时给出协作处置指引,而不只是技术性的 re-read 提示。
问题: check_stale 的 sibling 警告(Case 1)只让 agent 重读文件,未告知
      存在活跃兄弟会话、并行编辑风险及处置选项——收到警告后仍可能继续
      覆盖(F4/v19 实战教训:警告出现后依然被覆盖)。
解决: 两处 sibling 警告追加协作指引:提示 worktree 隔离(hermes -w /
      git worktree add)或与对方协调,避免进一步 clobber。文本英文
      简短、通用(不引用本地私有技能名),可提上游 PR;与 open PR
      NousResearch#65605(fail-closed 拦截,改 file_tools.py)方向互补、零文件冲突。
笔记: [[2026-08-15-多Agent同仓库协作]]
andrexibiza added a commit to andrexibiza/hermes-agent that referenced this pull request Aug 15, 2026
… + client + models + plugin)

Depends on: NousResearch#86951 (bytedance-shared)
Ref NousResearch#86950 (EPIC)
Ref NousResearch#86953 (Lane 2)

- plugins/platforms/tiktok_business/plugin.yaml (platform kind)
- webhook.py: HMAC-SHA256 verifier + event parser (nested payload.message, msg_type variants)
- policy.py: capability-aware policy engine
- client.py: TikTok Business API client
- models.py: API models
- adapter.py: PlatformAdapter implementation
- plugin.py: register(ctx) -> ctx.register_platform()

7 files pass ast.parse syntax validation.

Co-authored-by: Ares <a@b.com>
andrexibiza added a commit to andrexibiza/hermes-agent that referenced this pull request Aug 15, 2026
… + models + plugin)

Depends on: NousResearch#86951 (bytedance-shared)
Ref NousResearch#86950 (EPIC)
Ref NousResearch#86954 (Lane 3)

- plugins/platforms/douyin/plugin.yaml (platform kind)
- webhook.py: Douyin webhook verifier + parser (webhook_type/content format)
- policy.py: direction resolution + scene-aware send grants
- client.py: Douyin Open API client
- models.py: API models
- adapter.py: PlatformAdapter implementation
- plugin.py: register(ctx) -> ctx.register_platform()

8 files pass ast.parse syntax validation.

Co-authored-by: Ares <a@b.com>
andrexibiza added a commit to andrexibiza/hermes-agent that referenced this pull request Aug 15, 2026
…_content, schemas, mcp_config)

Depends on: NousResearch#86951, NousResearch#86952, NousResearch#86953
Ref NousResearch#86950 (EPIC)
Ref NousResearch#86955 (Lane 4)

- plugins/bytedance_ops/plugin.yaml (tools kind)
- schemas.py: all tool JSON schemas
- tiktok_organic.py: read + prepare/commit tools (posts, comments, publish, moderation)
- tiktok_creator.py: creator connection + posting
- tiktok_admin.py: TikTok Business Messaging admin
- douyin_content.py: Douyin account/scope/content/message tools
- mcp_config.py: MCP server configuration
- plugin.py: register(ctx) -> ctx.register_tool()

8 files pass ast.parse syntax validation.

Co-authored-by: Ares <a@b.com>
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have tool/file File tools (read, write, patch, search) labels Aug 15, 2026
andrexibiza added a commit to andrexibiza/hermes-agent that referenced this pull request Aug 15, 2026
… + client + models + plugin)

Depends on: NousResearch#86951 (bytedance-shared)
Ref NousResearch#86950 (EPIC)
Ref NousResearch#86953 (Lane 2)

- plugins/platforms/tiktok_business/plugin.yaml (platform kind)
- webhook.py: HMAC-SHA256 verifier + event parser (nested payload.message, msg_type variants)
- policy.py: capability-aware policy engine
- client.py: TikTok Business API client
- models.py: API models
- adapter.py: PlatformAdapter implementation
- plugin.py: register(ctx) -> ctx.register_platform()

7 files pass ast.parse syntax validation.

Co-authored-by: Ares <a@b.com>
@Enough1122

Copy link
Copy Markdown
Contributor

AI code review — automated review for reference, author can ignore or act on any point.

fix(file_state): sibling stale-warning now guides worktree isolation

  1. check_stale has no knowledge of whether the workspace is actually a Git repository, so the new "isolate in a git worktree (hermes -w / git worktree add)" hint is emitted even for users working in non-Git directories, where it is noise. Minor — since this is a suggestion inside an error string, gating it (e.g. on a .git presence probe) or keeping the message generic would avoid confusing non-Git users.
  2. Otherwise a pure message change with no behavioral impact; the two message variants stay in sync with each other, which is the only maintenance risk worth watching.

This branch has not been deployed

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

Labels

P3 Low — cosmetic, nice to have tool/file File tools (read, write, patch, search) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants