Skip to content

feat(storage): extend storage backend to scheduled jobs, plans, and shell history#925

Draft
inference-gateway-maintainer[bot] wants to merge 13 commits into
mainfrom
fix/issue-485
Draft

feat(storage): extend storage backend to scheduled jobs, plans, and shell history#925
inference-gateway-maintainer[bot] wants to merge 13 commits into
mainfrom
fix/issue-485

Conversation

@inference-gateway-maintainer

@inference-gateway-maintainer inference-gateway-maintainer Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

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

  • Add ScheduledJobStorage, PlanStorage, ShellHistoryStorage interfaces and PlanRecord/ScheduledJobChangeEvent types to internal/infra/storage/interfaces.go
  • Add Stores aggregate struct returned by NewStorage
  • Add schema migrations (003-005) for scheduled_jobs, plans, and shell_history tables in both sqlite and postgres
  • Implement all three new interfaces in jsonl, sqlite, postgres, redis, memory, and d1 backends
  • Refactor factory.go to return Stores aggregate
  • Add migrate.go for legacy artifact migration (schedules, plans, shell history)
  • Refactor scheduler to use ScheduledJobStorage (delete store.go, make scheduler backend-agnostic)
  • Refactor request_plan_approval.go to use PlanStorage, return infer://plans/ URI
  • Refactor shell_history.go to shim over ShellHistoryStorage
  • Wire new stores in container.go and update call sites
  • Add cmd/plans.go for infer plans show command
  • Regenerate counterfeiter mocks
  • Extend conformance tests for new interfaces
  • Fix MemoryStorage.Watch() to broadcast change events (was a no-op, breaking scheduler hot-reload tests)
  • Fix ScheduleTool.openStore() to cache the store instance (was creating a new MemoryStorage on every call)
  • Update docs (scheduling.md) to reflect storage-backend-agnostic architecture

@edenreich

edenreich commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@infer Can you continue on the task?

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Model: ollama_cloud/deepseek-v4-flash · View Job

Todos

  • Understand current state - read key files to see what's done and what's missing
  • Refactor request_plan_approval.go to use PlanStorage, return infer://plans/ URI
  • Refactor shell_history.go to shim over ShellHistoryStorage
  • Add cmd/plans.go for infer plans show command
  • Regenerate counterfeiter mocks
  • Extend conformance tests for new interfaces
  • [~] Update docs (scheduling.md, plan-mode.md, CLAUDE.md)
  • Run task fmt && task lint && task test

Pull Request

#925

⚠️ Infer Result: Stopped early

The agent hit the job's time limit before finishing, so it was stopped to salvage its work. Its committed changes were pushed; the draft pull request is linked above.

Let me use head to get the exact content and rewrite the file:

Model: ollama_cloud/deepseek-v4-flash · Exit Code: 0 · Duration: 24m 4s

Tokens: 24,113,494 in · 31,769 out · 24,145,263 total (111 requests)

Tool calls: 129 total · 89% success rate

Traces
Session: 1784238514-2536823a

session (in progress)                     23m58s
├── chat ollama_cloud/deepseek-v4-flash     1.8s
├── execute_tool Bash                       23ms [error: tool_error]
├── execute_tool Bash                       28ms
├── chat ollama_cloud/deepseek-v4-flash     2.3s
├── execute_tool Bash                       10ms
├── chat ollama_cloud/deepseek-v4-flash    12.7s
├── execute_tool TodoWrite                  56µs
├── chat ollama_cloud/deepseek-v4-flash     3.0s
├── execute_tool Read                      563µs
├── execute_tool Read                      246µs
├── execute_tool Read                      171µs
├── chat ollama_cloud/deepseek-v4-flash     6.9s
├── execute_tool Read                        1ms
├── execute_tool Read                      410µs
├── execute_tool Read                      338µs
├── chat ollama_cloud/deepseek-v4-flash     4.2s
├── execute_tool Grep                      314ms
├── execute_tool Grep                       96ms
├── chat ollama_cloud/deepseek-v4-flash     4.1s
├── execute_tool Grep                      100ms
├── execute_tool Grep                      106ms
├── execute_tool Grep                      106ms
├── chat ollama_cloud/deepseek-v4-flash     3.8s
├── execute_tool Read                      211µs
├── execute_tool Read                      172µs
├── execute_tool Read                      109µs
├── chat ollama_cloud/deepseek-v4-flash     6.5s
├── execute_tool Grep                      839µs
├── execute_tool Read                      165µs
├── chat ollama_cloud/deepseek-v4-flash     4.2s
├── execute_tool Read                      196µs
├── execute_tool Read                      294µs
├── chat ollama_cloud/deepseek-v4-flash     6.6s
├── execute_tool Grep                       79ms
├── execute_tool Read                      284µs
├── chat ollama_cloud/deepseek-v4-flash     5.3s
├── execute_tool Read                      222µs
├── execute_tool Read                      160µs
├── chat ollama_cloud/deepseek-v4-flash     6.0s
├── execute_tool Read                      173µs
├── execute_tool Grep                      361µs
├── chat ollama_cloud/deepseek-v4-flash     4.6s
├── execute_tool Read                      161µs
├── chat ollama_cloud/deepseek-v4-flash     7.9s
├── execute_tool TodoWrite                  84µs
├── chat ollama_cloud/deepseek-v4-flash    18.1s
├── chat ollama_cloud/deepseek-v4-flash     5.7s
├── execute_tool Edit                      525µs
├── chat ollama_cloud/deepseek-v4-flash     6.2s
├── execute_tool Edit                      434µs
├── chat ollama_cloud/deepseek-v4-flash    16.1s
├── execute_tool Edit                      442µs
├── chat ollama_cloud/deepseek-v4-flash     8.4s
├── execute_tool Edit                      412µs
├── chat ollama_cloud/deepseek-v4-flash     7.0s
├── chat ollama_cloud/deepseek-v4-flash     7.1s
├── execute_tool Bash                      47.8s [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash     6.8s
├── execute_tool Read                      172µs
├── chat ollama_cloud/deepseek-v4-flash     6.6s
├── execute_tool Read                      266µs
├── chat ollama_cloud/deepseek-v4-flash     7.5s
├── execute_tool Edit                      615µs
├── chat ollama_cloud/deepseek-v4-flash     6.9s
├── execute_tool Bash                       1.1s
├── chat ollama_cloud/deepseek-v4-flash     7.3s
├── chat ollama_cloud/deepseek-v4-flash     7.1s
├── execute_tool Bash                       11ms
├── chat ollama_cloud/deepseek-v4-flash     7.5s
├── execute_tool Bash                      20.5s [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash     9.2s
├── execute_tool Grep                      387µs
├── chat ollama_cloud/deepseek-v4-flash     7.9s
├── execute_tool Grep                        1ms
├── chat ollama_cloud/deepseek-v4-flash     8.3s
├── execute_tool Read                      180µs
├── chat ollama_cloud/deepseek-v4-flash     9.1s
├── execute_tool Edit                      299µs
├── chat ollama_cloud/deepseek-v4-flash     7.2s
├── execute_tool Read                      162µs
├── chat ollama_cloud/deepseek-v4-flash     7.4s
├── execute_tool Grep                      379µs
├── chat ollama_cloud/deepseek-v4-flash     7.3s
├── execute_tool Grep                      412µs
├── chat ollama_cloud/deepseek-v4-flash     7.6s
├── execute_tool Edit                      421µs
├── chat ollama_cloud/deepseek-v4-flash     7.3s
├── execute_tool Bash                       13ms
├── chat ollama_cloud/deepseek-v4-flash     7.2s
├── execute_tool Bash                       5.0s [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash    10.3s
├── execute_tool Read                      151µs
├── chat ollama_cloud/deepseek-v4-flash     7.4s
├── execute_tool Grep                      304µs
├── chat ollama_cloud/deepseek-v4-flash     6.8s
├── execute_tool Edit                      516µs
├── chat ollama_cloud/deepseek-v4-flash     7.6s
├── execute_tool Bash                        9ms
├── chat ollama_cloud/deepseek-v4-flash     7.1s
├── execute_tool Bash                       7.9s [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash    17.2s
├── execute_tool Edit                      478µs
├── chat ollama_cloud/deepseek-v4-flash    12.6s
├── execute_tool Edit                      483µs
├── chat ollama_cloud/deepseek-v4-flash     9.0s
├── execute_tool Edit                      475µs
├── chat ollama_cloud/deepseek-v4-flash     8.3s
├── execute_tool Bash                        9ms
├── chat ollama_cloud/deepseek-v4-flash     8.3s
├── execute_tool Bash                      16.1s
├── chat ollama_cloud/deepseek-v4-flash     8.7s
├── execute_tool Bash                       1.0s
├── chat ollama_cloud/deepseek-v4-flash    10.5s
├── execute_tool TodoWrite                  78µs
├── chat ollama_cloud/deepseek-v4-flash     8.8s
├── execute_tool Read                      219µs
├── chat ollama_cloud/deepseek-v4-flash    24.7s
├── execute_tool Edit                      373µs
├── chat ollama_cloud/deepseek-v4-flash    15.6s
├── execute_tool Edit                      406µs
├── chat ollama_cloud/deepseek-v4-flash    11.6s
├── execute_tool Bash                      147ms
├── chat ollama_cloud/deepseek-v4-flash    10.0s
├── execute_tool Bash                        9ms
├── chat ollama_cloud/deepseek-v4-flash     8.7s
├── execute_tool Bash                      19.3s
├── chat ollama_cloud/deepseek-v4-flash     9.9s
├── execute_tool Bash                       1.1s
├── chat ollama_cloud/deepseek-v4-flash    16.6s
├── execute_tool TodoWrite                  84µs
├── chat ollama_cloud/deepseek-v4-flash     9.4s
├── execute_tool Read                      178µs
├── chat ollama_cloud/deepseek-v4-flash    15.2s
├── execute_tool Write                       1ms
├── chat ollama_cloud/deepseek-v4-flash     9.4s
├── execute_tool Edit                      378µs
├── chat ollama_cloud/deepseek-v4-flash     9.9s
├── execute_tool Bash                      259ms [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash    17.6s
├── execute_tool Edit                      366µs
├── chat ollama_cloud/deepseek-v4-flash    13.6s
├── execute_tool Edit                      422µs
├── chat ollama_cloud/deepseek-v4-flash    10.3s
├── execute_tool Bash                       1.4s
├── chat ollama_cloud/deepseek-v4-flash    10.3s
├── execute_tool Bash                        9ms
├── chat ollama_cloud/deepseek-v4-flash    10.7s
├── execute_tool Bash                       3.7s [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash    11.4s
├── execute_tool Edit                      327µs
├── chat ollama_cloud/deepseek-v4-flash    10.3s
├── execute_tool Bash                       10ms
├── chat ollama_cloud/deepseek-v4-flash    10.3s
├── execute_tool Bash                       5.9s
├── chat ollama_cloud/deepseek-v4-flash     9.2s
├── execute_tool Bash                       1.1s
├── chat ollama_cloud/deepseek-v4-flash    11.0s
├── execute_tool TodoWrite                  76µs
├── chat ollama_cloud/deepseek-v4-flash     9.5s
├── execute_tool Bash                      1m38s
├── chat ollama_cloud/deepseek-v4-flash    10.1s
├── execute_tool Bash                       12ms
├── chat ollama_cloud/deepseek-v4-flash    10.2s
├── execute_tool Bash                       3.0s [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash    11.5s
├── execute_tool TodoWrite                  63µs
├── chat ollama_cloud/deepseek-v4-flash    10.9s
├── execute_tool Read                      218µs
├── chat ollama_cloud/deepseek-v4-flash    10.9s
├── execute_tool Read                      149µs
├── chat ollama_cloud/deepseek-v4-flash    10.1s
├── execute_tool Edit                      505µs
├── chat ollama_cloud/deepseek-v4-flash    22.0s
├── execute_tool Edit                      427µs
├── chat ollama_cloud/deepseek-v4-flash    11.2s
├── execute_tool Bash                      115ms
├── chat ollama_cloud/deepseek-v4-flash    12.1s
├── execute_tool Bash                        9ms
├── chat ollama_cloud/deepseek-v4-flash    11.3s
├── execute_tool Bash                       1.7s [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash    24.5s
├── execute_tool Edit                      571µs
├── chat ollama_cloud/deepseek-v4-flash    14.9s
├── execute_tool Bash                        9ms
├── chat ollama_cloud/deepseek-v4-flash    11.7s
├── execute_tool Bash                       2.5s [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash    20.8s
├── chat ollama_cloud/deepseek-v4-flash    12.9s
├── execute_tool Edit                      435µs
├── chat ollama_cloud/deepseek-v4-flash    13.2s
├── execute_tool Edit                      410µs
├── chat ollama_cloud/deepseek-v4-flash    21.3s
├── execute_tool Edit                      385µs
├── chat ollama_cloud/deepseek-v4-flash    12.8s
├── execute_tool Bash                       10ms
├── chat ollama_cloud/deepseek-v4-flash    13.0s
├── execute_tool Bash                       2.4s [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash    11.7s
├── execute_tool Edit                      449µs
├── chat ollama_cloud/deepseek-v4-flash    12.9s
├── execute_tool Edit                      402µs
├── chat ollama_cloud/deepseek-v4-flash    13.4s
├── execute_tool Edit                      356µs
├── chat ollama_cloud/deepseek-v4-flash    13.5s
├── execute_tool Bash                       10ms
├── chat ollama_cloud/deepseek-v4-flash    13.5s
├── execute_tool Bash                       3.9s
├── chat ollama_cloud/deepseek-v4-flash    11.7s
├── execute_tool Bash                       1.1s
├── chat ollama_cloud/deepseek-v4-flash    27.2s
├── execute_tool TodoWrite                  59µs
├── chat ollama_cloud/deepseek-v4-flash    16.0s
├── execute_tool Read                      190µs
├── execute_tool Read                      275µs [error: tool_error]
├── execute_tool Read                      154µs
├── chat ollama_cloud/deepseek-v4-flash    13.6s
├── execute_tool Bash                        3ms
├── chat ollama_cloud/deepseek-v4-flash    18.2s
├── execute_tool Read                      133µs [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash    14.4s
├── execute_tool Bash                        3ms
├── chat ollama_cloud/deepseek-v4-flash    13.4s
├── execute_tool Bash                        3ms
├── chat ollama_cloud/deepseek-v4-flash    11.7s
├── execute_tool Bash                        3ms
├── chat ollama_cloud/deepseek-v4-flash    12.2s
├── execute_tool Bash                        3ms
├── chat ollama_cloud/deepseek-v4-flash    18.1s
├── execute_tool Edit                      265µs [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash    12.5s
├── chat ollama_cloud/deepseek-v4-flash    14.5s
├── chat ollama_cloud/deepseek-v4-flash    11.9s
╰── execute_tool Bash                        4ms
Stats
Tool Calls

╭───────────┬───────┬───────┬────────╮
│ Tool      │ Calls │ Fail% │ Avg    │
├───────────┼───────┼───────┼────────┤
│ Bash      │ 43    │ 26%   │ 5691ms │
│ Read      │ 30    │ 7%    │ 0ms    │
│ Edit      │ 27    │ 4%    │ 0ms    │
│ Grep      │ 13    │ 0%    │ 62ms   │
│ TodoWrite │ 7     │ 0%    │ 0ms    │
│ Write     │ 1     │ 0%    │ 1ms    │
╰───────────┴───────┴───────┴────────╯

Token Usage

╭────────────────────────────────┬──────────┬────────────┬──────────┬──────╮
│ Model                          │ Prompt   │ Completion │ Total    │ Cost │
├────────────────────────────────┼──────────┼────────────┼──────────┼──────┤
│ ollama_cloud/deepseek-v4-flash │ 23787959 │ 31681      │ 23819640 │ -    │
╰────────────────────────────────┴──────────┴────────────┴──────────┴──────╯
⚠️ 14 log(s)
  • Bash:
    exit status 128: fatal: origin/main...HEAD: no merge base
    
  • Bash:
    exit status 1: # github.com/inference-gateway/cli/internal/agent/tools
    internal/agent/tools/schedule.go:38:13: undefined: config
    … (truncated)
    
  • Bash:
    exit status 1: pre-commit: using task from PATH (/opt/hostedtoolcache/task/3.48.0/x64/bin/task)
    �[32mtask: [fmt] go fmt ./...
    … (truncated)
    
  • Bash:
    exit status 1: pre-commit: using task from PATH (/opt/hostedtoolcache/task/3.48.0/x64/bin/task)
    �[32mtask: [fmt] go fmt ./...
    … (truncated)
    
  • Bash:
    exit status 1: pre-commit: using task from PATH (/opt/hostedtoolcache/task/3.48.0/x64/bin/task)
    �[32mtask: [fmt] go fmt ./...
    … (truncated)
    
  • Bash:
    exit status 1: # github.com/inference-gateway/cli/cmd
    cmd/plans.go:76:2: declared and not used: services
    … (truncated)
    
  • Bash:
    exit status 1: pre-commit: using task from PATH (/opt/hostedtoolcache/task/3.48.0/x64/bin/task)
    �[32mtask: [fmt] go fmt ./...
    … (truncated)
    
  • Bash:
    exit status 1: pre-commit: using task from PATH (/opt/hostedtoolcache/task/3.48.0/x64/bin/task)
    �[32mtask: [fmt] go fmt ./...
    … (truncated)
    
  • Bash:
    exit status 1: pre-commit: using task from PATH (/opt/hostedtoolcache/task/3.48.0/x64/bin/task)
    �[32mtask: [fmt] go fmt ./...
    … (truncated)
    
  • Bash:
    exit status 1: pre-commit: using task from PATH (/opt/hostedtoolcache/task/3.48.0/x64/bin/task)
    �[32mtask: [fmt] go fmt ./...
    … (truncated)
    
  • Bash:
    exit status 1: pre-commit: using task from PATH (/opt/hostedtoolcache/task/3.48.0/x64/bin/task)
    �[32mtask: [fmt] go fmt ./...
    … (truncated)
    
  • Read:
    UNREADABLE_BINARY
    
  • Read:
    UNREADABLE_BINARY
    
  • Edit:
    old_string not found in file /home/runner/work/cli/cli/docs/scheduling.md
    
    … (truncated)
    

Triggered by edenreich · Infer Action

@edenreich

Copy link
Copy Markdown
Contributor

@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.

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Model: ollama_cloud/deepseek-v4-flash · View Job

Todos

  • Fix MemoryStorage.Watch() to broadcast change events
  • Fix ScheduleTool.openStore() to cache store instance
  • Run tests to verify fixes
  • Regenerate counterfeiter mocks
  • [~] Update docs (scheduling.md, plan-mode.md, CLAUDE.md)
  • Run precommit checks and push

…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.
@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor Author

✅ Infer Result: Success

Everything is finalized - git status is clean, all tests pass, PR title and body are updated, and the branch is pushed.

Model: ollama_cloud/deepseek-v4-flash · Exit Code: 0 · Duration: 10m 4s

Tokens: 7,864,894 in · 16,230 out · 7,881,124 total (61 requests)

Tool calls: 74 total · 93% success rate

Traces
Session: 1784240122-5278bc31

session (standard, success)                10m2s
├── chat ollama_cloud/deepseek-v4-flash     2.7s
├── execute_tool Bash                       20ms [error: tool_error]
├── execute_tool Bash                       25ms
├── chat ollama_cloud/deepseek-v4-flash     2.7s
├── execute_tool Bash                        7ms
├── execute_tool Bash                        8ms
├── chat ollama_cloud/deepseek-v4-flash     5.4s
├── execute_tool TodoWrite                  65µs
├── chat ollama_cloud/deepseek-v4-flash     2.5s
├── execute_tool Bash                      51.4s
├── chat ollama_cloud/deepseek-v4-flash     2.9s
├── chat ollama_cloud/deepseek-v4-flash    10.1s
├── chat ollama_cloud/deepseek-v4-flash     2.7s
├── execute_tool Bash                       9.0s
├── chat ollama_cloud/deepseek-v4-flash     2.6s
├── execute_tool Bash                       2.0s
├── execute_tool Bash                      24.9s [error: tool_error]
├── execute_tool Bash                      15.4s [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash     3.7s
├── execute_tool Read                      255µs
├── execute_tool Read                      265µs
├── chat ollama_cloud/deepseek-v4-flash     3.8s
├── execute_tool Read                      679µs
├── execute_tool Read                        1ms
├── execute_tool Read                      799µs
├── chat ollama_cloud/deepseek-v4-flash     4.6s
├── execute_tool Read                      193µs
├── execute_tool Read                      130µs
├── chat ollama_cloud/deepseek-v4-flash    12.8s
├── execute_tool TodoWrite                  62µs
├── chat ollama_cloud/deepseek-v4-flash    15.7s
├── chat ollama_cloud/deepseek-v4-flash     6.3s
├── execute_tool Edit                      792µs
├── chat ollama_cloud/deepseek-v4-flash     3.9s
├── execute_tool Read                      169µs
├── chat ollama_cloud/deepseek-v4-flash     5.0s
├── execute_tool Read                      307µs
├── chat ollama_cloud/deepseek-v4-flash     4.7s
├── execute_tool Edit                      308µs
├── chat ollama_cloud/deepseek-v4-flash     5.4s
├── execute_tool Edit                      316µs
├── chat ollama_cloud/deepseek-v4-flash     5.0s
├── execute_tool Edit                      287µs
├── chat ollama_cloud/deepseek-v4-flash     5.3s
├── execute_tool TodoWrite                  63µs
├── chat ollama_cloud/deepseek-v4-flash     5.2s
├── execute_tool Edit                      518µs
├── chat ollama_cloud/deepseek-v4-flash     6.1s
├── execute_tool Edit                      339µs
├── chat ollama_cloud/deepseek-v4-flash    12.3s
├── execute_tool TodoWrite                  47µs
├── chat ollama_cloud/deepseek-v4-flash     5.1s
├── execute_tool Bash                       4.7s
├── chat ollama_cloud/deepseek-v4-flash     5.8s
├── execute_tool Bash                       4.6s
├── chat ollama_cloud/deepseek-v4-flash     5.4s
├── chat ollama_cloud/deepseek-v4-flash     5.0s
├── execute_tool Bash                      1m22s
├── chat ollama_cloud/deepseek-v4-flash     6.1s
├── execute_tool TodoWrite                  58µs
├── chat ollama_cloud/deepseek-v4-flash     5.7s
├── execute_tool Grep                      683µs
├── chat ollama_cloud/deepseek-v4-flash     7.4s
├── execute_tool Read                      142µs
├── chat ollama_cloud/deepseek-v4-flash     6.1s
├── execute_tool Grep                       44ms
├── chat ollama_cloud/deepseek-v4-flash     6.2s
├── execute_tool TodoWrite                  64µs
├── chat ollama_cloud/deepseek-v4-flash     6.2s
├── execute_tool Read                      489µs
├── execute_tool Read                      112µs [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash     5.2s
├── execute_tool Bash                        3ms
├── chat ollama_cloud/deepseek-v4-flash     6.4s
├── execute_tool Bash                        3ms
├── chat ollama_cloud/deepseek-v4-flash     6.4s
├── chat ollama_cloud/deepseek-v4-flash     6.5s
├── execute_tool Read                      113µs [error: tool_error]
├── chat ollama_cloud/deepseek-v4-flash     5.7s
├── execute_tool Bash                        2ms
├── chat ollama_cloud/deepseek-v4-flash     6.6s
├── chat ollama_cloud/deepseek-v4-flash     5.9s
├── execute_tool Bash                        3ms
├── chat ollama_cloud/deepseek-v4-flash     5.9s
├── chat ollama_cloud/deepseek-v4-flash     5.5s
├── execute_tool Bash                        2ms
├── chat ollama_cloud/deepseek-v4-flash     5.3s
├── execute_tool Bash                        3ms
├── chat ollama_cloud/deepseek-v4-flash    15.4s
├── execute_tool Write                       1ms
├── chat ollama_cloud/deepseek-v4-flash     6.0s
├── execute_tool Bash                        2ms
├── chat ollama_cloud/deepseek-v4-flash     6.9s
├── execute_tool TodoWrite                  52µs
├── chat ollama_cloud/deepseek-v4-flash     6.4s
├── execute_tool Bash                       9.6s
├── chat ollama_cloud/deepseek-v4-flash     5.9s
├── execute_tool Bash                        8ms
├── chat ollama_cloud/deepseek-v4-flash     6.4s
├── execute_tool Bash                        9ms
├── chat ollama_cloud/deepseek-v4-flash     7.0s
├── execute_tool Bash                       2.7s
├── chat ollama_cloud/deepseek-v4-flash     6.2s
├── execute_tool Bash                       1.2s
├── chat ollama_cloud/deepseek-v4-flash     6.5s
├── execute_tool Bash                       25ms
├── execute_tool Bash                        9ms
├── chat ollama_cloud/deepseek-v4-flash     8.7s
├── chat ollama_cloud/deepseek-v4-flash     8.8s
├── execute_tool Bash                       1.6s
├── chat ollama_cloud/deepseek-v4-flash     9.1s
├── chat ollama_cloud/deepseek-v4-flash     8.9s
├── execute_tool Write                     788µs
├── chat ollama_cloud/deepseek-v4-flash     8.1s
├── execute_tool Bash                       1.7s
├── chat ollama_cloud/deepseek-v4-flash    12.8s
├── execute_tool TodoWrite                  62µs
├── chat ollama_cloud/deepseek-v4-flash     8.6s
├── chat ollama_cloud/deepseek-v4-flash     8.1s
├── execute_tool Bash                       25ms
├── execute_tool Bash                        9ms
├── chat ollama_cloud/deepseek-v4-flash    10.7s
╰── chat ollama_cloud/deepseek-v4-flash     7.8s
Stats
Tool Calls

╭───────────┬───────┬───────┬────────╮
│ Tool      │ Calls │ Fail% │ Avg    │
├───────────┼───────┼───────┼────────┤
│ Bash      │ 30    │ 10%   │ 7014ms │
│ Read      │ 13    │ 15%   │ 0ms    │
│ TodoWrite │ 8     │ 0%    │ 0ms    │
│ Edit      │ 6     │ 0%    │ 0ms    │
│ Grep      │ 2     │ 0%    │ 22ms   │
│ Write     │ 2     │ 0%    │ 0ms    │
╰───────────┴───────┴───────┴────────╯

Token Usage

╭────────────────────────────────┬─────────┬────────────┬─────────┬──────╮
│ Model                          │ Prompt  │ Completion │ Total   │ Cost │
├────────────────────────────────┼─────────┼────────────┼─────────┼──────┤
│ ollama_cloud/deepseek-v4-flash │ 8084482 │ 16252      │ 8100734 │ -    │
╰────────────────────────────────┴─────────┴────────────┴─────────┴──────╯

Sessions

╭───────────┬──────────┬──────────╮
│ Execution │ Mode     │ Sessions │
├───────────┼──────────┼──────────┤
│ headless  │ standard │ 1        │
╰───────────┴──────────┴──────────╯
⚠️ 5 log(s)
  • Bash:
    exit status 128: fatal: origin/main...HEAD: no merge base
    
  • Bash:
    exit status 1: --- FAIL: TestService_WatchReload_AddsNewJob (5.02s)
        scheduler_test.go:194: expected [added-later] after save, got []
    … (truncated)
    
  • Bash:
    exit status 1: --- FAIL: TestScheduleTool_Execute_CRUDLifecycle (0.00s)
        schedule_test.go:178: list returned wrong content: []
    … (truncated)
    
  • Read:
    UNREADABLE_BINARY
    
  • Read:
    UNREADABLE_BINARY
    

Triggered by edenreich · Infer Action

…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
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.

[TASK] Extend storage backend to scheduled jobs, plans, and shell history

1 participant