Skip to content

feat(cases): add log-time SDK method + CLI command for human time logging#309

Merged
maximelb merged 1 commit into
masterfrom
solve/case-log-time-90035
Jun 20, 2026
Merged

feat(cases): add log-time SDK method + CLI command for human time logging#309
maximelb merged 1 commit into
masterfrom
solve/case-log-time-90035

Conversation

@maximelb

Copy link
Copy Markdown
Contributor

What was asked

Humans had no way to log their time on a case from the SDK or CLI. The cases service already exposes a time-logs endpoint, but nothing in this client called it, so the human-effort input to the AI cost/savings model could never be populated. Add the SDK method and CLI command.

What was done

  • SDK: Cases.log_time(case_number, billable_seconds, cost_profile=None, assignee=None, note=None)POST api/v1/cases/{n}/time-logs, mirroring the existing add_note (optional fields omitted from the body when unset).
  • CLI: limacharlie case log-time --case-number N --seconds S [--cost-profile K] [--assignee A] [--note T], with a client-side positive-seconds guard for a clean error.
  • cost_profile tags the logged time with a cost-model profile key so it can be valued at that profile's rate downstream.

Key files: limacharlie/sdk/cases.py, limacharlie/commands/case_cmd.py, plus tests.

Testing

  • tests/unit/test_sdk_cases.py — new TestLogTime (verb/path/query + body, all optionals, none-excluded).
  • tests/unit/test_cli_case.py — new TestCaseLogTime (minimal, all options, non-positive rejection) + help-list and mocked-method-list updates.
  • tests/unit/test_cli_lazy_loading_regression.py — added log-time to the pinned case subcommand set.
  • Full unit suite: 3379 passed, 5 skipped (run with -o addopts="" and excluding two tests that need the toon_format module, which isn't installed locally — infra-only, unrelated to this change). pytest-benchmark is likewise not installed locally; CI has both.

🤖 Generated with Claude Code

https://claude.ai/code/session_012ie78qt9UBuvCBEEfLRKT3

…ging

The cases service exposes POST /api/v1/cases/{n}/time-logs to record billable
human time on a case (the measured human-effort input that nets down the AI
cost/savings figure), but there was no SDK or CLI way to call it. Add:

- Cases.log_time(case_number, billable_seconds, cost_profile=None,
  assignee=None, note=None) -> POST .../time-logs, mirroring add_note.
- `limacharlie case log-time --case-number N --seconds S [--cost-profile K]
  [--assignee A] [--note T]`, with a client-side positive-seconds check.

Unit tests for both (SDK body/verb/path + optional handling; CLI invocation +
non-positive rejection) and updated the subcommand-structure regression test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ie78qt9UBuvCBEEfLRKT3
@maximelb

Copy link
Copy Markdown
Contributor Author

✅ AI-APPROVED

@maximelb maximelb marked this pull request as ready for review June 20, 2026 21:48
@maximelb maximelb requested a review from a team June 20, 2026 21:48
@maximelb maximelb merged commit f45603f into master Jun 20, 2026
7 checks passed
@maximelb maximelb deleted the solve/case-log-time-90035 branch June 20, 2026 21:49
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