Repository navigation
feat(sessions): play a custom sound file on run settle - #4
Closed
Direct-Launch wants to merge 1 commit into
Closed
Direct-Launch wants to merge 1 commit into
Direct-Launch wants to merge 1 commit into
Conversation
A settlement cue could only be the built-in 880/320 Hz tone. Users who want their own sound had no way to supply one. Add optional success/failure sound-file paths, read from disk at play time and falling back to the built-in tone when the file is missing or undecodable. Desktop-only: the fields are hidden on mobile, and the reader returns null where there is no filesystem. The decision stays pure (cueForOutcome) so it is testable without an AudioContext; only emission touches the filesystem. Decoded buffers and in-flight decodes are cached per path so a settle does not re-read the same file.
5 tasks done
Owner
Author
|
Consolidated into #1. Every commit here is included in feat/session-sidebar, which now targets main and carries the whole stack plus its real-vault test evidence. Closing this so there is one review surface. |
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.
What
Adds optional custom sound-file paths to the run-settle cue. Two settings,
runSuccessSoundPathandrunFailureSoundPath, take absolute OS paths; the file is read from disk and decoded at play time, falling back to the built-in 880/320 Hz tone when the path is empty, the file is missing, or it decodes to nothing.cueForOutcomestays pure, so the decision is testable without anAudioContext.How I tested it
Real vault, Obsidian 1.13.7, desktop (Windows). Set an absolute success path in Agents settings, started a run from a gesture (send/Enter, which is what unlocks audio), and confirmed the configured file plays when the run settles — the built-in tone is not used. The change is additive: with no path set, the existing tone still plays.
Unit level: 13 targeted tests, and the two new file-branch tests were falsified first — forcing the branch to
nullturned exactly those two red and left the other eleven green.The failure-path file was not separately exercised; it shares the same code path as success.
AI assistance: drafted by an AI agent (Smart Second Brain); reviewed and tested live by me.
Design
cueForOutcomereturns{ kind: "default", frequency } | { kind: "file", path } | null— pure, so noAudioContextin tests.readFileBytesreturnsnullwhere there is norequire, and the fields sit inside the existingisMobileUIguard.Checklist
check/format/lintpass locally — run via the npm equivalents (npx biome format,npx biome lintexit 0 across./src ./test ./integration;svelte-check0 errors / 0 warnings on both configs).bunis not available on the machine this was prepared on.test— all 13 new tests pass. The suite reports one failure,test/skills/shippedSkillHistory.test.ts, which is pre-existing and Windows-clone-only (core.autocrlf=true, no.gitattributes): it fails identically with this change reverted, and CI checks out LF.manifest.jsonis unchanged, so the docs site needs no updateStacked on
Base is
integrate/sidebar-2026-10-01, which carries the settle-cue fixes, so this diff is the sound-file change alone. CONTRIBUTING asks for PRs againstmain; this one is deliberately stacked, consistent with the existing #1 / #2 chain.