Skip to content

test(shells,cron): cover the #75 follow-ups; pin per-response subagent pricing (#78) - #131

Merged
JayantDevkar merged 1 commit into
mainfrom
test/bg-shells-cron-coverage-78
Oct 22, 2026
Merged

JayantDevkar merged 1 commit into
mainfrom
test/bg-shells-cron-coverage-78

Conversation

@JayantDevkar

Copy link
Copy Markdown
Owner

Problem

#78 listed the risky paths from the bg-shells/cron data layer (#75) that had no tests. Tests only; no production code changes.

Changes

  • _is_session_ended: ENDED/LIVE/WAITING/STALE states and the absent-file stale/fresh mtime cases.
  • POST /shells/{id}/kill: terminated_by='kill' even when lsof finds no PID; pids_signalled mirrors stubbed lsof; no lsof → nothing runs; already-terminated left alone; unknown id 404.
  • <task-notification> natural exit: <tool-use-id> path (completed/failed/timeout) and the <task-id> fallback for !-backgrounded shells.
  • Read-on-output-file polls (the current polling path) and Manual (!) shell extraction incl. the synthetic poll and persistence.
  • v19 background_shells rebuild, parametrized from the real v13 and v18 shapes: reaches v24, keeps rows and child polls, accepts 'Manual', keeps FKs on, flags reindex.
  • croniter-absent guard, cron_jobs (deleted_at, deleted_via) CHECK.
  • Mixed-model subagent pricing is per response and stable across calls (get_primary_model was removed in Fix session analytics accuracy: dedupe usage, current pricing, active time #106, so the non-determinism item is moot).

Verification

Each new test was checked to fail with its code path broken (guard removed, check inverted, branch deleted). Full api suite alone: 2066 passed, 6 skipped (23 new). ruff check and format clean on the touched files.

Follow-ups

Closes #78

https://claude.ai/code/session_019dHRodCxwuwTvnKtUNrUU7

…t pricing (#78)

Already covered on main: the router test-isolation fix (the client fixture stubs _maybe_sync), and get_primary_model's non-determinism, which #106 removed by pricing each response with its own model. This adds tests for _is_session_ended, POST /shells/{id}/kill with lsof and kill stubbed, <task-notification> natural exits through both the tool-use-id path and the task-id fallback, Read-on-output-file polls, and !-backgrounded Manual shells. It also adds the v19 background_shells rebuild starting from the real v13 and v18 table shapes, the croniter-absent guard, and the cron_jobs deleted_at/deleted_via coherence CHECK. A mixed-model subagent test pins per-response pricing so a single primary-model pick cannot return. No production code changes.

Claude-Session: https://claude.ai/code/session_019dHRodCxwuwTvnKtUNrUU7
@JayantDevkar
JayantDevkar merged commit 95b8097 into main Oct 22, 2026
13 checks passed
@JayantDevkar
JayantDevkar deleted the test/bg-shells-cron-coverage-78 branch October 22, 2026 14:18
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.

Follow-up from #75: test coverage + deferred nits (bg-shells/cron)

1 participant