Repository navigation
feat(extension): run Timer in API v2 background runtime - #2
Merged
Merged
Conversation
Move timer ownership out of the disposable panel and into one startup runtime so commands, wall-clock deadlines, settings, reminders, and app notifications survive with zero views. Preserve v1 saved data and add a v2 state shape that restores an in-progress reminder instead of silently resetting it.\n\nRefs #1\nRefs Juliusolsson05/agent-code#934
This was referenced Sep 13, 2026
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.
Timer promises a focus timer that keeps running when its panel closes, but API v1 activates the extension inside each view document. Closing the panel destroyed the engine, its commands, the reminder schedule and the notification path.
Behavior
dist/runtime.js,onStartupFinished) owns timing, commands, wall-clock persistence and reminders. The panel (dist/view.js) is an independent subscriber over published JSON state; user actions return as named runtime requests with validated input.notifications.showAPI, so they surface as an attributed Agent Code toast with no panel open. The chime stays in the view, where autoplay applies.timer.defaultMinutesandtimer.inheritThemesettings are read by the runtime. A setting change never rewrites an active deadline; a viewlessStart Timercommand honors the latest default.Verification
npm test: 12 behavioral tests — wall-clock timing, pause/resume, delayed reminder firing, reminder restore, expiry announced once, long-sleep correction, publication rate, invalid mutations, runtime settings, active-deadline protection, viewless start, malformed actions.npm run typecheck,NODE_ENV=production npm run build, andnpm run test:extension(independent runtime/view entries; audio only in the view bundle).Dependencies
notifications.show): feat(extensions): add shared runtimes and independent view authoring agent-code-extension-api#1 at96acc89Merge after both dependencies. The installed extension requires an Agent Code build containing API v2.
Fixes #1
🤖 Generated with Claude Code
https://claude.ai/code/session_01SnzR4ggdHfDfmFcTA7H8kw