Feat/local llm sources - #6
Merged
Merged
Conversation
…aiting PermissionRequest fires when the permission system evaluates a tool call, not when a human is actually being asked - subagent read-only tool calls were flipping sessions red 105 times per 48h. Treat bare PermissionRequest as working for every provider (previously codex only); AskUserQuestion-shaped payloads still go straight to waiting. Genuine prompts are covered by the permission_prompt Notification Claude Code sends after ~6s of a prompt actually pending, which already maps to waiting - the tool/command summary from the preceding PermissionRequest is stashed (120s TTL) so that transition now shows the real command instead of the generic permission message. Trade-off: a real permission prompt turns red ~6s later than before; false flapping and bogus notifications are gone.
Codex's hook channel has no user-decision event and goes silent while an approval prompt is pending (verified against the 0.144.4 embedded schemas: 10 lifecycle events, no heartbeat, notify only fires on turn-complete), so silence after a bare PermissionRequest is itself the signal. The read side now promotes a codex session to waiting when its last hook event is a PermissionRequest older than codex_permission_wait_seconds (default 10, 0 disables), reusing the stashed command summary as waiting_detail; any later hook event clears it. The TUI alert scheduler sends the system notification for these promotions since no hook runs at promotion time. Known limitations (documented in both READMEs): allow and deny are indistinguishable, a denied prompt stays red until the next event, and headless --watch does not send the promotion notification.
A turn that ends with the assistant asking a plain-text question (no AskUserQuestion tool, no permission prompt) used to land on idle, so the board never showed there was something to answer. Stop events now inspect last_assistant_message (present in both claude-code and codex payloads; transcript tail as fallback): if the last non-empty line outside code fences ends with a question mark, the session goes to waiting with kind=question and the question as detail. Deliberately conservative - mid-message questions and statement endings stay idle; detect_stop_questions=false turns it off.
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.
No description provided.