Skip to content

feat(studio): unify the workbench and proactive runtime - #764

Merged
jinliyl merged 22 commits into
mainfrom
codex/proactive-summary-recovery
Nov 23, 2026
Merged

jinliyl merged 22 commits into
mainfrom
codex/proactive-summary-recovery

Conversation

@jinliyl

@jinliyl jinliyl commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR brings scheduled and observation-driven work into the same proactive runtime and shares the ReMe Studio workbench across Web, Desktop, Android, and iOS. ReMe owns task execution, session state, and workspace records. Studio consumes the same client contracts on each platform.

Proactive runtime and daily records

  • Give each background task one durable queue for observations and cron triggers. Consecutive observations can run as a batch. Each cron trigger runs in its own round, in queue order, with its scheduled time and actual start time available to the agent.
  • Run one round per task at a time. Changing or clearing a cron schedule affects future triggers and leaves queued input and the observation cooldown intact.
  • Store findings, source links, and reminder decisions in a daily Markdown record. Cron rounds require a record. Observation rounds can return NO_KEY_INFORMATION when there is no material update. Resolve local source links relative to the record.
  • Allow one read-only follow-up in the same native session to repair invalid YAML frontmatter. Validate the structured correction and apply it only if the draft version still matches. Preserve the Markdown body and edits made while the correction was pending.
  • Hold the workspace file lock across record validation, input acknowledgement, and the first reminder handoff. Register the reminder only after durable acknowledgement. Recover an interrupted handoff from the committed acknowledgement and source record. Failed and cancelled rounds preserve written Markdown and leave unacknowledged input available for retry.

Remy, reminders, and Notebook

  • Use the workspace-relative daily record path as the reminder ID. The record stores delivered_at, read_at, and linked chat_message_ids. Reminder and inbox views use the same record fields and processing state.
  • Select reminder batches by item count and UTF-8 bytes, with priority, chat activity, and notification windows determining when to evaluate a batch. A disposable read-only chat fork makes an explicit send or silent decision. The runtime revalidates sources before committing that decision.
  • Keep Studio's explicit user-read receipts in its presentation state. Web tabs merge the settings and receipt fields they changed, preserving concurrent edits from other tabs.
  • Add reme todo action=list_projects for one project list across Todo and Idea records, with per-project counts and active, archived, and all scopes. New records use the default project when one is absent. Creating a Todo from an Idea can inherit its project and text.

Studio across platforms

  • Share the HTTP/SSE client and React workbench for Remy, Proactive AI, Notebook, and Knowledge. CI compares the generated TypeScript wire contract with the Python schemas.
  • Serve the Web workbench through the opt-in proactive preset. Desktop retains the Remy companion, tray, and native notifications, with a user-initiated update flow for supported release packages.
  • Bundle the same mobile workbench in the Kotlin/WebView and SwiftUI/WKWebView apps. Both default to http://127.0.0.1:2333. Settings → General accepts a complete HTTP or HTTPS service URL, including a routable IP and port. Connect saves the address and restarts the connection. The app reconnects to that address on launch.
  • Reuse one mobile settings path and the shared API client and SSE parser. Android uses WebView networking, and iOS uses URLSession for transport. Web Studio uses its configured service address.

Packaging and documentation

  • Synchronize the ReMe, Studio static package, and Desktop versions with scripts/bump_version.py. Published releases build the PyPI and npm packages, Desktop installers for macOS, Windows, and Linux, and multi-architecture Docker images.
  • Allow maintainers to dispatch a release from its tag and select PyPI, npm, Desktop, and Docker independently. Check the tag and checkout SHA before building for npm provenance. Desktop uploads installers and update manifests to the matching release.
  • Publish the Web workbench as the static Python package under reme_studio/web/python. Docker checks cover the default memory service, persistent files across container replacement, and the Studio entry point and health endpoint under proactive.
  • Remove the hosted Studio Playground, its sample service, standalone build, and site promotion. GitHub Pages builds the documentation independently of Studio. The bilingual repository guides cover Studio development and releases and label the ReMe5 preview as a roadmap.
  • Honor request-level wikilink expansion, retain actionable job errors, and omit fork-only SDK options when starting an empty thread.

Related issue

Follow-up to #743.

Contract and data impact

  • No public configuration, schema, CLI, endpoint, streaming, or workspace-layout contract changes
  • No user-owned memory files are deleted or rewritten
  • Derived indexes, catalogs, graphs, caches, and metadata remain rebuildable

Configure tasks under components.proactive_runtime.default. Send a nonempty observation batch to an existing task with append_task_events. Use task_document for TASK.md and pass the returned mtime as expected_mtime when saving.

The runtime writes daily records and updates their frontmatter under the workspace lock. Daily records use daily/YYYY-MM-DD/{agent_name}_HHMMSS.md with a numeric suffix when needed. Frontmatter uses reminder_priority and reminder_message. Use list_task_reminders and list_agent_inbox for reminder views. read_agent_reminder accepts a record path or a chat message ID.

Start Studio with reme start config=proactive or set REME_CONFIG=proactive in Docker. The default preset continues to serve the memory API. The GitHub Pages site links to the repository's Studio guides for setup.

Validation

  • Focused tests pass
  • Unit tests pass, or omitted tests are explained below
  • pre-commit run --all-files passes, or omitted checks are explained below
  • Frontend checks were run when reme_studio/ changed

At 36fbf9f0:

  • 84 focused Python tests and 49 Studio tests passed. Studio formatting, type checking, and the production Web build passed.
  • Android debug assembly and lint passed. The Android and iOS simulators switched to a non-loopback HTTP address, received the ReMe API response and an SSE session snapshot, then reconnected to the saved address after restart.
  • 21 documentation tests passed. The documentation build verified 43 artifacts. Pre-commit passed on the changed files.
  • Mobile smoke tests used an isolated HTTP/SSE fixture. Physical devices, live model providers, production release publishing, and the full Python and pre-commit suites were outside this follow-up run.

Earlier branch validation covered 4,207 Python tests with 46 skips, the Python 3.11–3.14 CI matrix, Hermes, Windows CLI, CodeQL, release configuration checks, production Studio builds, macOS Desktop connectivity, and Docker persistence on both architectures. GitHub checks

Checklist

  • I reviewed the diff for unrelated changes and sensitive data
  • Tests cover intentional behavior changes
  • Defaults, schemas, and concise documentation were updated together when required
  • Long-lived clients, tasks, services, and executors follow the application lifecycle

Screenshots or additional notes

See the Proactive Runtime guide and the Studio guide for runtime setup and platform development.

…-file decision

- Add ProactiveAgentStepV2 class to support single daily note decision and reminder
- Introduce RoundOutputs for v2 round file tracking, and keep RoundArtifacts for v1 summary backup
- Refactor AgentOutbox to support both v1 standalone reminder files and v2 daily reminder records
- Add proactive_record utilities to parse and validate v2 daily record frontmatter and metadata
- Enhance proactive_agent to prepare, read, and manage artifacts for both v1 and v2 flows
- Add configuration profile proactive_v2 to enable new workflow with backward compatibility
- Update proactive.yaml and reactive proactive_agent_step configuration comment for easy switching
- Provide extensive schema validation for v2 reminders ensuring priority and message consistency
- Document v2 workflow and usage in English and Chinese runtime docs
- Add unit tests for v2 step verifying single file output and proper decision handling
@jinliyl
jinliyl force-pushed the codex/proactive-summary-recovery branch from 7ae72cc to 8017029 Compare November 21, 2026 09:29
…plify reminder handling

- Remove ReminderRef model and switch to using workspace-relative string keys for reminders
- Simplify AgentOutbox to read, write, and manage reminders keyed by strings
- Change file locking and version checking to protect concurrent edits on daily record files
- Replace legacy and v2 reminder file handling with unified ReminderFiles storage
- Adjust ChatNotifications to operate with the new key scheme and update pending/read sets
- Refactor RoundOutputs to RoundRecord for safer round record tracking and rollback
- Remove unused ProactiveRunResult and related references from imports and exports
- Update InboxWakeRequest, AgentReminder, and related models for consistent ID and path validation
- Adjust proactive agent runtime and local runtime to check reminder versions before commit
- Correct language and docs to describe reminders as daily records instead of separate files
- Clean up roles of inbox and outbox for reminder ownership, delivery, and acknowledgments
@jinliyl jinliyl changed the title fix(proactive): simplify round files and restore failed summaries refactor(proactive): store each round and its reminder in one record Nov 22, 2026
@jinliyl jinliyl changed the title refactor(proactive): store each round and its reminder in one record refactor(proactive): unify task triggers and reminder records Nov 22, 2026
@jinliyl jinliyl changed the title refactor(proactive): unify task triggers and reminder records feat(studio): unify the workbench and proactive task execution Nov 23, 2026

@ployts ployts left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address the two P1 findings before merging. I reproduced the draft rollback, legacy receipt recovery, and cross-tab read receipt issues with isolated fixtures.

Comment thread reme/steps/proactive/agent/proactive.py Resolved
Comment thread .github/workflows/release-python.yml Resolved
Comment thread reme_studio/client/src/browser-host.ts Resolved

@ployts ployts left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified the three fixes from the previous review. Failed acknowledgement and cancellation preserve the written record, the release guard accepts a matching tag and rejects a branch or SHA mismatch, and stale browser tabs preserve each other's settings and read receipts.

The legacy pending-reminder behavior remains an intentional cutover for workspaces from the earlier main-branch preview. Please document that pending reminders in that format will be skipped and advise preview users to process them before switching. Previous thread

Please fix the new P1 before merging. Preserving failed Markdown is the right behavior, and the retained record needs to stay out of reminder delivery until its input is committed.

Local validation passed 290 focused Python tests, 48 Studio tests, and 21 documentation tests, plus Studio formatting, type checking, the client contract check, and the Web and documentation builds. I exercised the release guard locally with no registry publishing.

Comment thread docs/en/proactive_runtime.md Resolved
@jinliyl jinliyl changed the title feat(studio): unify the workbench and proactive task execution feat(studio): unify the workbench and proactive runtime Nov 23, 2026

@ployts ployts left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified that the original copied-delivered_at reproduction stays out of Remy's inbox during the failed round and after restart. A durable receipt still recovers registration without rewriting the Markdown, and both guides now describe the failure behavior. The earlier preview format still has the direct cutover described in the previous thread.

Two new findings affect the outbox and Android connection changes below. Local validation passed 356 focused Python tests, 49 Studio tests, and 21 documentation tests, plus formatting, type checking, the client contract check, and the Web, mobile frontend, and documentation builds. I checked the Android permission requirement against platform documentation. Native device validation was outside this review.

Comment thread reme/steps/proactive/agent/proactive.py Resolved

@ployts ployts left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original path collision is fixed when a JSON registration exists. I also verified the Android permission declaration and request flow and exercised denial and regrant through a mocked WebView bridge. The author reported an API 37 emulator pass.

One path collision still reproduces during recovery before registration. Please cover that part of the durable handoff as well.

Local checks passed 250 focused Python tests, 49 Studio tests, 21 documentation tests, the client contract check, type checking, formatting, and the Web, mobile frontend, and documentation builds. Native Android execution was outside my local validation.

Comment thread reme/steps/proactive/agent/proactive.py Resolved

@ployts ployts left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The outstanding reminder-path finding is resolved. The allocator now reserves paths referenced by durable receipts even before registration. The daylight-saving fallback regression passed. I also checked a restart with an older unregistered reminder receipt followed by a newer receipt with no reminder. The new round used a distinct path, and restoring the first Markdown recovered its original reminder.

All 266 focused Python tests passed locally. The Python 3.11–3.14 and Studio checks also passed on this commit. Python CI · Studio CI

@jinliyl
jinliyl merged commit 524b1b6 into main Nov 23, 2026
18 checks passed
@jinliyl
jinliyl deleted the codex/proactive-summary-recovery branch November 23, 2026 10:21
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.

2 participants