/wt-diff doesn't list a worktree a Workflow agent edited in a background session
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 22/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- git, typescript
Research direction
Start with the diff module's tool.call hook, the part that records directories for Edit, Write and Bash calls, and its .catch handler, which currently drops errors silently. The first step is to log errors there and check whether the throw happens after await next(e), which would call next twice. Then add a case to tests/diff.test.tsx where a tool.call carries an agentId. Done when the workflow agent's worktree appears in /wt-diff in that test and a reproduction no longer loses it.
Written by the indexing model from the issue text.
Description
What happens
In a Claude Code background session (Claude Code 2.1.310), a Workflow tool run started one agent with isolation: "worktree". Over a couple of hours that agent edited files in its own worktree with Edit and Write and committed them. Afterwards, /wt-diff in the same session didn't list the agent's worktree. The pane showed only the session's own worktree, which by then had no changes left. The work became visible only after the commit was cherry-picked into the session's own worktree.
Expected
The module's header says it notes "each directory Edit, Write or NotebookEdit wrote a file in, and each one a Bash call ran in or changed a file in, subagents' calls included", so the workflow agent's worktree should be listed.
What I checked
I ran a headless session (claude -p --plugin-dir) with a small probe plugin whose tool.call hook logs each call and appends to a $.state value, and whose turn.complete hook logs that value. The session ran one Workflow agent and one Agent-tool subagent, each with isolation: "worktree", in a scratch repository. Each agent wrote a file with Write and ran pwd with Bash.
tool.callfired for both agents' Write and Bash calls. Each carried the agent'sagentId,$.session.cwd()returned the agent's worktree, andfile_pathpointed inside it.- The values those hooks appended to
$.statewere all present when the main loop'sturn.completeread them.
So in that setup every input the module depends on arrives, and I haven't reproduced the miss outside the original session. That session differed in four ways:
- It was a daemon-backed background session, not
claude -p. - It loaded the installed marketplace copy of the plugin (5b3bf92d0ffe), not
--plugin-dir. - It ran for several hours, with a compaction before the workflow started.
- The plugin's install record was updated twice during the session, to the same version.
Two things that would help pin it down
- The
tool.callhook ends in.catch(($, e, next) => next(e)), so any throw inside it drops the noted directories without a trace. Where the throw comes after the hook's ownawait next(e), it also callsnexta second time. Logging the error there would make the next occurrence diagnosable. tests/diff.test.tsxhas no case where atool.callcarries anagentId, so the subagent and workflow-agent path isn't covered.
Seen on worktrunk 5b3bf92d0ffe.
This was written by Claude Code on behalf of max-sixty
- Dominant language
- Rust
- Stars
- 8.8k
- Forks
- 315
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 204
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from max-sixty/worktrunk
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
max-sixty/worktrunk#4727 · 7 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
max-sixty/worktrunk#4260 · 5 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
max-sixty/worktrunk#3847 · 1 comment ·
Maintainers usually reply within 1 day
-
`wt step` confusionOpen
Difficulty 5/5 Over a week Newbie friendliness 28/100
max-sixty/worktrunk#4728 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
max-sixty/worktrunk#4718 · 1 comment ·
Maintainers usually reply within 1 day
All issues in max-sixty/worktrunk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
carrick-sh/carrick#1859 ·
Maintainers usually reply within 1 day
-
crate: spate-kafka documentation priority: medium
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
balovess/aria2_rust#88 ·