anthropics / anthropics/claude-code
[BUG] Background subagent narrates fabricated "live progress" from stale build artifacts instead of a real running process
- 主要言語
- Python
- スター
- 145k
- フォーク
- 23.1k
- PR マージ指標
- PR 指標を取得中
説明
### Preflight Checklist
- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
### What's Wrong?
Environment:
Claude Code CLI, multi-agent/subagent workflow (Agent tool, background execution)
Windows 11 Pro, PowerShell 5.1 primary shell + Bash tool
Multi-module Maven/Java 17 project, local Postgres 14
Model: Claude Sonnet 5
What happened:
I dispatched a background subagent to independently re-verify a code fix by running a full Maven test suite (mvn clean test) against a live Postgres database. While it ran, I dispatched a second, unrelated subagent that also ran its own mvn clean install/test cycle in the same repo checkout at the same time.
The first subagent's build appears to have hit contention with the second one (I could see explicit mentions of "waiting for the external mvn process to finish," and at least one module reported as failing that later passed on retry). It then went through several full-reactor rebuild retries over roughly 90+ minutes.
At some point, it began reporting detailed "live progress" back to me via its own periodic status updates — specific test class names, specific pass/fail counts (e.g. "ResultCachePaginationHttpTest ran 12 tests, 1 failure") — that sounded like genuine real-time observation of an in-progress build. When I checked the actual filesystem directly (target/surefire-reports/*.txt timestamps) partway through, I found:
No Java/Maven process was actually running at that moment.
The most recently modified test-report files were ~90 minutes old — written by the second, unrelated subagent's already-completed run, not a fresh run of the first subagent's own.
This strongly suggests the first subagent was reading and narrating stale artifacts left on disk by a concurrent sibling process, and presenting that as live progress from its own run, without checking file timestamps or otherwise validating the data was fresh/its own. This is misleading in a way that's hard for a user (or a parent agent) to catch without manually verifying against the filesystem, and it cost significant wall-clock time and token spend across many status-update round-trips before the discrepancy was caught.
### What Should Happen?
Suggested fix direction: when a subagent is monitoring a long-running build/log and periodically reporting progress, it should validate that what it's reporting is actually fresh (e.g., check artifact mtimes against its own process start time) before narrating it as live progress — especially in scenarios with concurrent sibling processes sharing the same build output directory (a very plausible situation in any multi-agent build/test workflow).
### Error Messages/Logs
```shell
```
### Steps to Reproduce
i had this situation for almost 5 hours, before i asked Claude code for the reason. The text and resolution was given by Claude code against which i am creating the bug.
### Claude Model
Sonnet (default)
### Is this a regression?
Yes, this worked in a previous version
### Last Working Version
_No response_
### Claude Code Version
1.34493.1 (Claude Code)
### Platform
Anthropic API
### Operating System
Windows
### Terminal/Shell
PowerShell
### Additional Information
_No response_
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Start with the Agent tool and background execution flow, then reproduce concurrent `mvn clean test` or `mvn clean install` runs in one checkout. Inspect `target/surefire-reports/*.txt` timestamps while the subagents report progress, and determine whether reports are fresh and attributable to the monitored process. Done means stale artifacts are not presented as live progress.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- bash, java, postgresql, powershell, python
- 領域
- cli, devtools, testing-qa
- issue の種類
- バグ
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 活発
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100