feat::Feature/add reminder of unfinshed todo#22060
Open
ahmedfe wants to merge 136 commits intoanomalyco:devfrom
Open
feat::Feature/add reminder of unfinshed todo#22060ahmedfe wants to merge 136 commits intoanomalyco:devfrom
ahmedfe wants to merge 136 commits intoanomalyco:devfrom
Conversation
When users press Ctrl+C to clear the input field, the current prompt is now saved to history before clearing. This allows users to navigate back to cleared prompts using arrow keys, preventing loss of work. Addresses anomalyco#11489
Adds a toggle command in the System category that allows users to enable
or disable saving cleared prompts to history. The feature is disabled by
default to preserve existing behavior.
When enabled via the command palette ("Include cleared prompts in history"),
pressing Ctrl+C will save the current prompt to history before clearing it,
allowing users to navigate back with arrow keys.
The setting persists in kv.json.
Add a toggleable auto-accept mode that automatically accepts all incoming permission requests with a 'once' reply. This is useful for users who want to streamline their workflow when they trust the agent's actions. Changes: - Add permission_auto_accept keybind (default: shift+tab) to config - Remove default for agent_cycle_reverse (was shift+tab) - Add auto-accept logic in sync.tsx to auto-reply when enabled - Add command bar action to toggle auto-accept mode (copy: "Toggle autoaccept permissions") - Add visual indicator showing 'auto-accept' when active - Store auto-accept state in KV for persistence across sessions
…rtcut support Rename 'Toggle autoaccept permissions' to 'Toggle permissions' for clarity and move the command to the Agent category for better discoverability. Add permission_auto_accept_toggle keybind to enable keyboard shortcut toggling of auto-accept mode for permission requests.
…hable by 'toggle permissions'
…rent state in toggle titles
…orkflow interruptions while still requiring confirmation for bash commands
…emory/opencode into feat/canceled-prompts-in-history
Avoid adding duplicate entries to prompt history when the same input is appended multiple times (e.g., clearing with ctrl+c then restoring via history navigation and clearing again).
# Conflicts: # packages/opencode/src/cli/cmd/tui/component/prompt/history.tsx
Tighten the dictation UI and Whisper model settings, update the mobile package metadata, and remove the stale npm lockfile so Bun stays the source of truth for builds.
…ompts in the history, toggled by a KV-persisted command palette item (resolves anomalyco#11489)
…dering for prompt loop exit and message rendering
…rve dependencies
…nt conversation context
Contributor
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
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.
ssue for this PR
Closes #22059
Type of change
[x] New feature
What does this PR do?
When an agent finishes a session while there are still pending or in-progress todos, the todo list gets left in a stale state — items stay marked as pending or in_progress even though the work was completed. This is confusing when reviewing past sessions.
This PR adds a pendingTodoReminder step to the session prompt loop. After the agent signals it's done and before the session actually ends, it checks the session's todo list for any items with pending or in_progress status. If unfinished todos exist, it injects a synthetic user message listing them and asks the agent to reconcile the list. This causes the loop to continue for one more turn so the agent can mark items as completed or cancelled.
To avoid infinite loops, the reminder is suppressed if the last user message is already a todo reminder (checked via a prefix match on the message text).
Changes are in packages/opencode/src/session/prompt.ts:
Import and wire up Todo.Service in the session prompt
Add pendingTodoReminder effect that checks for unfinished todos and injects a synthetic message
Call the reminder after the agent finishes but before breaking out of the prompt loop
Provide Todo.defaultLayer to the session prompt's dependency layer
How did you verify your code works?
Tested locally by running sessions with todo items and confirming that when the agent tries to finish with unfinished todos, it receives the synthetic reminder and updates the todo list before the session ends. Also ran bun typecheck in packages/opencode.
Screenshots / recordings
Not included.
Checklist
[x] I have tested my changes locally [x] I have not included unrelated changes in this PR