Skip to content

Comments

feat: support toast notifications via notificationType config option#321

Closed
essinghigh wants to merge 30 commits intoOpencode-DCP:betafrom
essinghigh:notification-config
Closed

feat: support toast notifications via notificationType config option#321
essinghigh wants to merge 30 commits intoOpencode-DCP:betafrom
essinghigh:notification-config

Conversation

@essinghigh
Copy link
Contributor

Closes #319

This PR introduces notificationType as a new configuration option, allowing users to choose between chat and toast for prune notifications.

Changes:

  • Added notificationType to PluginConfig and VALID_CONFIG_KEYS
  • Set the default notificationType to "chat" in defaultConfig
  • Updated dcp.schema.json to include the new option, validating for ["chat", "toast"]
  • Added validateConfigTypes support for the new setting
  • Updated sendUnifiedNotifications in lib/ui/notifications.ts to support rendering toasts via client.tui.showToast when the setting is enabled
  • Extracted notification construction logic into buildPruneDetails to avoid code duplication between the two message types

If sending the notification via showToast fails, it falls back to using a standard chat message.

Screenshot:
Image

Tarquinen and others added 10 commits January 24, 2026 18:52
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
@Tarquinen
Copy link
Collaborator

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

@Tarquinen Tarquinen changed the base branch from master to beta January 28, 2026 02:46
@Tarquinen
Copy link
Collaborator

Tarquinen commented Jan 28, 2026

nevermind looks like no changes needed on your end for the merge to beta, just take a look at the comment comment was wrong

@Tarquinen
Copy link
Collaborator

Tarquinen commented Jan 28, 2026

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

Tarquinen and others added 2 commits January 27, 2026 22:16
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.
@essinghigh
Copy link
Contributor Author

essinghigh commented Jan 28, 2026

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.

@Tarquinen
Copy link
Collaborator

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?

@essinghigh
Copy link
Contributor Author

essinghigh commented Jan 28, 2026

Where they only pop up for a couple seconds I don't think it's a huge deal unless the extraction/summary is extremely excessive.

However just thinking about avoiding ugly verticality - it might make sense to truncate the toast past a certain length. For chat messages this of course isn't preferable as you'd lose message context but it doesn't make much of a difference in a toast notification which disappears after a few seconds.

image image

Something like this look good to you?

@Tarquinen
Copy link
Collaborator

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
@Tarquinen Tarquinen deleted the branch Opencode-DCP:beta January 31, 2026 00:53
@Tarquinen Tarquinen closed this Jan 31, 2026
@essinghigh essinghigh deleted the notification-config branch January 31, 2026 11:34
@Tarquinen
Copy link
Collaborator

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?

@essinghigh essinghigh restored the notification-config branch January 31, 2026 17:46
@essinghigh
Copy link
Contributor Author

essinghigh commented Jan 31, 2026

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.
Are you able to reopen & review/merge into dev if all good?

@Tarquinen
Copy link
Collaborator

Tarquinen commented Jan 31, 2026

I can't reopen this PR, could you create a new PR from your notification-config branch targeting dev? The branch looks good and I'm ready to merge once you do. Sorry for the inconvenience!

@Tarquinen
Copy link
Collaborator

If there are any conflicts due to changes I made since you branched off I can fix them myself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR/Suggestion: Support showToast for DCP notifications

2 participants