feat(cases): add log-time SDK method + CLI command for human time logging#309
Merged
Conversation
…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
lcbill
approved these changes
Jun 20, 2026
Contributor
Author
|
✅ AI-APPROVED |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Cases.log_time(case_number, billable_seconds, cost_profile=None, assignee=None, note=None)→POST api/v1/cases/{n}/time-logs, mirroring the existingadd_note(optional fields omitted from the body when unset).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_profiletags 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— newTestLogTime(verb/path/query + body, all optionals, none-excluded).tests/unit/test_cli_case.py— newTestCaseLogTime(minimal, all options, non-positive rejection) + help-list and mocked-method-list updates.tests/unit/test_cli_lazy_loading_regression.py— addedlog-timeto the pinnedcasesubcommand set.-o addopts=""and excluding two tests that need thetoon_formatmodule, which isn't installed locally — infra-only, unrelated to this change).pytest-benchmarkis likewise not installed locally; CI has both.🤖 Generated with Claude Code
https://claude.ai/code/session_012ie78qt9UBuvCBEEfLRKT3