feat: support toast notifications via notificationType config option#321
feat: support toast notifications via notificationType config option#321essinghigh wants to merge 30 commits intoOpencode-DCP:betafrom
Conversation
Recover squash-related files from dangling stash commit: - squash tool implementation and utils - squash, discard-extract, discard-squash, extract-squash, all prompt variants - system and nudge prompts for all tool combinations
- Add ulid dependency for generating unique IDs - Replace timestamp-based ID counter with ulid - Ensures unique IDs across parallel operations
- Move squashSummaries out of prune object to top-level state - Add resetOnCompaction utility to clear stale state after compaction - Move findLastCompactionTimestamp and countTurns to state/utils.ts - Update isMessageCompacted to also check prune.messageIds - Update persistence to save/load squashSummaries at top level
- Move findStringInMessages, collectToolIdsInRange, collectMessageIdsInRange from squash.ts to tools/utils.ts for reusability - Keep squash.ts focused on tool definition and execution logic - Follows existing pattern where collectContentInRange lives in utils.ts
When opencode runs with OPENCODE_SERVER_PASSWORD set, the server requires HTTP Basic Auth. This adds auth utilities to detect secure mode and configure the SDK client with an interceptor that injects the Authorization header on all requests. Fixes Opencode-DCP#304
…-auth fix: add secure mode authentication support
…of creating new ones
|
This looks pretty good, but can you rebase it onto the beta branch? There shouldn't be many changes for you I think and the next release will be from that branch |
|
nevermind looks like no changes needed on your end for the merge to beta, |
|
This will need a minimal UI version as well, matching the detailed / minimal style of the ignored message, and some way to support showDistillation and showSummary, should be good to go with that |
Adds toast notifications that mirror the existing chat notifications in content and configuration respect (minimal/detailed, showDistillation, showSummary). Ensures exact text parity by reusing the message construction logic.
|
It looks like sendSquashNotification ignores showSummary when notifications are configured as minimal, do you want me to make this consistent with showDistillation (or vice-versa)? I've opted to leave it for now as changing it would be out of scope and I'm wary of feature-creep, but can include it in this pull if you want. |
|
minimal configuration should only show the header of the notification, so yea if showSummary is enabled but notification is set to minimal, it won't show up. You're right this is weird, but I think it makes more sense than showing a big summary in a "minimal" notification. The other thing is, extraction and summaries are a lot of text, how do you want to handle this for the toast? It looks ok to show in ignored messages, but I imagine it will look terrible in toasts. What do you think? |
|
Yea this looks like the best way to go |
- revert terse PR 313 style back to verbose prose format from dev branch - clarify tool triggers: discard/extract for individual outputs, squash for phases - remove 'task complete' trigger from discard/extract (exclusive to squash) - add instruction to not use discard/extract without prunable-tools list - replace 'task/sub-task' terminology with 'phase' to avoid conflict with Task tool
- Use tool part injection for DeepSeek/Kimi (requires reasoning_content in assistant messages) - Use text part injection for other models (cleaner approach) - Add prunedMessageCount to context breakdown display
|
I was going to look at this today but I messed something up in my merge to dev I'm sorry, did you still want to add this feature? |
No worries, I saw you were doing some moving about with the branches so thought I'd leave it for a little while. |
|
I can't reopen this PR, could you create a new PR from your |
|
If there are any conflicts due to changes I made since you branched off I can fix them myself |


Closes #319
This PR introduces
notificationTypeas a new configuration option, allowing users to choose betweenchatandtoastfor prune notifications.Changes:
notificationTypetoPluginConfigandVALID_CONFIG_KEYSnotificationTypeto "chat" indefaultConfigdcp.schema.jsonto include the new option, validating for["chat", "toast"]validateConfigTypessupport for the new settingsendUnifiedNotificationsinlib/ui/notifications.tsto support rendering toasts viaclient.tui.showToastwhen the setting is enabledbuildPruneDetailsto avoid code duplication between the two message typesIf sending the notification via
showToastfails, it falls back to using a standard chat message.Screenshot:
