Repository navigation
feat: answer a lich worker's task with its last message - #42
Merged
Merged
Conversation
A new mod, hooks/worker-answer.js, implements lich's mod-answer contract
(POST /mod/answer {session_id, text}). In a session spawned with
LICH_SUBAGENT_CARDS=off, which every `lich open --subagent` worker is, it
posts the final message of a main-loop turn whose classic.Stop listed no
background task and whose turn.complete ended with a non-blank answer. A
turn that backgrounded work answers only in the turn Claude Code resumes in;
aborted, failed, refused and subagent turns never answer. lich then hands
such a worker its task without the ticket and the reply instructions.
The fixture is vendored from the lich commit that adds the contract, which is
in no release yet.
A worker that ended its turn with a command left in the background is listed done, so the status line dropped it and TaskStop went to Claude Code while it still worked. A same-checkout worker now runs until lich stops listing it, which lich does once it reported; an isolated worker, which keeps its card, still ends at a done turn. The two status-line tests change because that rule changed.
# Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Client side of omartelo/lich feat/worker-auto-answer:
hooks/worker-answer.js: in a lich worker (LICH_SUBAGENT_CARDS=off), posts the turn's final message toPOST /mod/answerwhen the main loop'sStoplists no background tasks and the turn ended with an answer (not aborted, not blank); cut at 16,000 characters.Fixtures pinned to the lich branch until a release ships the contract. Tests: node 303/303,
claude plugin test .23/23, validate ok. Live: see the lich PR. Release as 0.17.0 after lich ships.