feat(storage): extend storage backend to scheduled jobs, plans, and shell history#925
feat(storage): extend storage backend to scheduled jobs, plans, and shell history#925inference-gateway-maintainer[bot] wants to merge 13 commits into
Conversation
…age interfaces and schema migrations
…ryStorage in all 6 backends
|
@infer Can you continue on the task? |
|
Model: Todos
Pull Request
|
…infer://plans/<id> URI
…wShellHistoryWithStore constructor
…rage, and ShellHistoryStorage
|
@infer Can you finalize the implementation and prepare this PR for a review? use /go /go-concurrency /ponytail:ponytail /bubbles-v2 or any other skills you need to accomplish this task. |
|
Model: Todos
|
…che store in ScheduleTool MemoryStorage.Watch() was a no-op that never emitted events, breaking scheduler hot-reload tests. Added a broadcaster pattern: SaveJob/DeleteJob now emit ScheduledJobChangeEvents to all registered watchers. ScheduleTool.openStore() created a new MemoryStorage on every call, so CRUD operations across multiple tool invocations in tests shared no state. Cached the store instance on the tool struct. Updated scheduling.md to reflect the storage-backend-agnostic architecture instead of the old filesystem/YAML approach.
✅ Infer Result: SuccessEverything is finalized - git status is clean, all tests pass, PR title and body are updated, and the branch is pushed. Model: Tokens: 7,864,894 in · 16,230 out · 7,881,124 total (61 requests) Tool calls: 74 total · 93% success rate TracesStats
|
…an-ID bugs Address review findings on the scheduled-jobs/plans/shell-history storage extension: - Delete dead code: migrate.go (zero callers), the unwired shell-history store shim, the legacy history-file migration, and the unused tools.schedule.storage_dir config knob - Replace the five per-backend Watch implementations with one 2s poll-and-diff reconcile loop in the scheduler; kills the jsonl send-on-closed-channel daemon panic, the sql/redis/d1 blocked-send goroutine leaks, and redis silently missing job updates - Plans: single write through PlanStorage with ID <UTC-stamp>-<slug> so infer://plans/<id> resolves on every backend (the returned UUID never resolved on jsonl); drop the dual-write that produced two files per plan and the double H1; parse CreatedAt from the ID so listing sorts; drop the unused Slug field; post-approval continuation now points the agent at 'infer plans show <id>' instead of a file path - Wire shell history through the storage backend (container -> input view) via a small StoreShellHistory provider; fix LIMIT 0 returning nothing on sql/d1 - Inject stores from the container into the tool registry; remove the racy lazy store caches in the Schedule and RequestPlanApproval tools - channels-manager fails loud when the scheduler is enabled on the memory backend instead of silently dropping every schedule - Redis: no conversation TTL on jobs/plans (they must not expire), KEYS -> SCAN; memory backend returns copies instead of shared pointers - Use config.StorageType constants everywhere instead of raw strings - Actually run the ScheduledJob/Plan/ShellHistory conformance suites against memory, jsonl, sqlite, postgres, and d1 (they were dead code) - Update scheduling and plan-mode docs, CLAUDE.md
Resolves #485
Summary
Extend the storage backend to cover scheduled jobs, plan-mode plans, and shell history - three artifact types that were previously hard-coded to the local filesystem regardless of the configured backend. Adds three new interfaces (ScheduledJobStorage, PlanStorage, ShellHistoryStorage) implemented across all six backends (jsonl, sqlite, postgres, redis, memory, d1), refactors the scheduler to be backend-agnostic, and adds a migration path for legacy on-disk artifacts.
Changes