fix: pause active goals on app background - #37
Merged
Conversation
BunsDev
force-pushed
the
fix/goal-background-pause
branch
from
August 1, 2026 07:48
73dfbac to
b9ae9a3
Compare
There was a problem hiding this comment.
Pull request overview
Adds durable on-device goal support (storage + FFI + Swift orchestration) and pauses active goals when the app backgrounds, keeping goal execution within the foreground lifecycle while exposing progress via UI and Live Activity scaffolding.
Changes:
- Introduces a checked, path-scoped goal SQLite store and wires goal cleanup into session deletion/fork flows (Rust).
- Adds goal lifecycle APIs to the UniFFI surface and implements an autonomous goal runner that persists durable goal output separately from working context (Rust).
- Adds
/goalparsing, goal UI card + background pause hook, and an ActivityKit + WidgetKit extension for goal progress presentation (Swift/iOS).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| rust/ffi/src/sessions.rs | Adds checked GoalStorage and integrates goal cleanup into session artifact deletion. |
| rust/ffi/src/lib.rs | Exposes the new goals module and a reconcile_goals engine entry point. |
| rust/ffi/src/goals.rs | Implements goal lifecycle helpers (create/pause/resume/reconcile/continue) and goal snapshot types. |
| rust/ffi/src/chat.rs | Adds goal execution loop, goal-only tool registry (GoalComplete), durable-message journaling, and uses canonical session ID in ToolContext. |
| rust/Cargo.toml | Bumps pinned coven-code engine rev to pick up upstream goal APIs. |
| rust/Cargo.lock | Updates lockfile to match the engine rev bump. |
| project.yml | Adds version settings and a WidgetKit app-extension target for goal widgets. |
| docs/superpowers/specs/2026-07-31-on-device-goals-design.md | Adds the on-device goals design/spec doc. |
| app/Tests/GoalCommandParserTests.swift | Adds test coverage for /goal command parsing behavior. |
| app/Sources/Views/ChatView.swift | Adds goal card UI and routes /goal commands via the parser. |
| app/Sources/Support/Goals/GoalCommandParser.swift | Implements strict local parsing for /goal commands and errors. |
| app/Sources/Support/Goals/GoalActivityCoordinator.swift | Adds an ActivityKit coordinator for goal Live Activity updates. |
| app/Sources/Support/Goals/GoalActivityAttributes.swift | Defines ActivityKit attributes/content state shared by app + widget. |
| app/Sources/Support/ChatModel.swift | Stores goal snapshot state, bridges goal callbacks to @MainActor, and hooks goal lifecycle actions into the model. |
| app/Sources/Generated/coven_pocket_ffi.swift | Regenerated UniFFI Swift bindings for the new goal APIs/types. |
| app/Sources/CovenPocketApp.swift | Pauses active goals when the scene transitions to background. |
| app/GoalWidgets/Info.plist | Adds widget extension Info.plist. |
| app/GoalWidgets/GoalLiveActivityWidget.swift | Adds the WidgetKit Live Activity/Dynamic Island UI. |
| .beads/issues.jsonl | Updates Beads issue export with goal-related tracking issues/status changes. |
| .beads/interactions.jsonl | Updates Beads interactions export with status change events. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Persists and cancels an active on-device goal when the app enters the background, keeping goal execution within the foreground lifecycle.
Validation: