You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix command cancellation and organize regression coverage - #14
Ordinary commands could continue issuing requests after cancellation, and download deadlines began after chat resolution. Carry the command context through name resolution, authentication recovery, history and key preparation, RPC dispatch, OBS token acquisition, and transfers. Add --timeout DURATION to whoami, contacts, chats, messages, send, download, react, and unsend; downloads retain a two-minute default that now covers preparation.
Check cancellation before subsequent remote steps while preserving persisted mutation sequences and single-attempt dispatch. Confirmed send receipts and warnings about uncertain delivery, uploads, group-key registration, or already-created plaintext file messages survive signal reporting. Existing non-context API entry points remain compatibility wrappers; SIGINT/SIGTERM exit codes remain 130/143.
Organize shared test fixtures into package-local helper files, keep Linux-specific helpers separate, retire an always-skipped legacy vector replay placeholder, and add a dedicated runner/LTSM regression CI job. Update command help, the translated CLI guides, and a new contributor testing guide.
Validation:
Main package tests with the race detector.
Full runner/LTSM regressions and standalone systemd-probe tests.
Native build and help, Linux/Windows builds, and Linux/Windows test compilation for the reorganized session and CLI fixtures.
goimports, go vet, staticcheck, workflow YAML, and documentation links.
Declaration audit preserved all executable tests and helper code; only the permanently skipped placeholder was removed.
All local checks passed using synthetic data and fake APIs. No live LINE actions were performed.
Summary
Improve command reliability with --timeout support, proper Ctrl+C cancellation, and safer handling of interrupted operations. Reorganize test helpers and expand CI coverage for encryption and signing regressions.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 2d7372ce-aa5f-45c7-aa89-3bca78cc3e67
📥 Commits
Reviewing files that changed from the base of the PR and between d63aabc and de6f337.
📒 Files selected for processing: 61
.github/workflows/cli.yml
.gitignore
AGENTS.md
README.md
cmd/line/signals.go
cmd/line/signals_test.go
docs/CLI.ja.md
docs/CLI.md
docs/CLI.th.md
docs/CLI.zh-TW.md
docs/TESTING.md
internal/cli/actions.go
internal/cli/auth_test.go
internal/cli/chats.go
internal/cli/chats_test.go
internal/cli/cli.go
internal/cli/cli_test.go
internal/cli/contacts.go
internal/cli/contacts_test.go
internal/cli/deadline.go
internal/cli/deadline_test.go
internal/cli/display.go
internal/cli/download.go
internal/cli/download_test.go
internal/cli/files_test.go
internal/cli/login_qr_test.go
internal/cli/messages.go
internal/cli/messages_test.go
internal/cli/prompt.go
internal/cli/prompt_test.go
internal/cli/storage_prepare_test.go
internal/cli/test_helpers_test.go
internal/messaging/actions.go
internal/messaging/actions_test.go
internal/messaging/cancellation_test.go
internal/messaging/client.go
internal/messaging/client_test.go
internal/messaging/files.go
internal/messaging/files_test.go
internal/messaging/keys.go
internal/messaging/test_helpers_test.go
internal/session/credential_format_test.go
internal/session/envelope_test.go
internal/session/manager.go
internal/session/manager_test.go
internal/session/session_files_test.go
internal/session/storage_linux_test.go
internal/session/storage_prepare_test.go
internal/session/test_helpers_linux_test.go
internal/session/test_helpers_test.go
internal/update/release_test.go
internal/update/test_helpers_test.go
pkg/line/client.go
pkg/line/methods.go
pkg/line/methods_context_test.go
pkg/line/qr_login_test.go
pkg/line/reaction_test.go
pkg/line/test_helpers_test.go
pkg/ltsm/embind_test.go
pkg/ltsm/test_helpers_test.go
pkg/runner_vectors_replay_test.go
💤 Files with no reviewable changes: 18
pkg/line/qr_login_test.go
internal/session/storage_linux_test.go
pkg/runner_vectors_replay_test.go
pkg/ltsm/embind_test.go
internal/messaging/files_test.go
internal/cli/messages_test.go
internal/cli/storage_prepare_test.go
internal/session/storage_prepare_test.go
internal/cli/login_qr_test.go
internal/cli/chats_test.go
internal/update/release_test.go
internal/cli/auth_test.go
internal/session/credential_format_test.go
internal/session/session_files_test.go
pkg/line/reaction_test.go
internal/messaging/client_test.go
internal/session/envelope_test.go
internal/cli/prompt_test.go
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
📝 Walkthrough
The CLI adds command-wide timeouts and propagates cancellation through CLI, session, messaging, and LINE API operations. Mutation errors retain details about possible remote effects. The change also adds cancellation tests, shared test fixtures, testing documentation, and a Linux CI job.
Changes: Command cancellation
Layer / File(s)
Summary
Context-aware LINE requests pkg/line/client.go, pkg/line/methods.go, pkg/line/methods_context_test.go, pkg/line/test_helpers_test.go, pkg/line/reaction_test.go, pkg/line/qr_login_test.go
LINE RPC and OBS methods add context-aware variants. Requests check cancellation before dispatch, and tests cover canceled RPCs, token preparation, and in-flight uploads.
Session context and mutation handling internal/session/manager.go, internal/session/manager_test.go, internal/session/*test.go
The session API adds context-taking methods and Manager.MutateContext. Canceled requests return before authentication recovery or mutation replay. Shared fixtures support session tests.
Context-aware messaging and mutation results internal/messaging/actions.go, internal/messaging/client.go, internal/messaging/files.go, internal/messaging/keys.go, internal/messaging/*test.go
Messaging operations pass contexts through history, key operations, sends, uploads, downloads, reactions, and unsends. MutationError preserves details about possible remote effects. Tests cover cancellation before and after dispatch.
CLI deadlines and command integration cmd/line/signals.go, cmd/line/signals_test.go, internal/cli/*.go, internal/cli/*test.go, docs/CLI*.md
Commands add --timeout, apply deadlines after parsing, and use login contexts for remote operations. Locking and stdin handling check cancellation. CLI documentation describes timeout defaults and cancellation outcomes.
Test guidance and CI coverage .github/workflows/cli.yml, .gitignore, AGENTS.md, README.md, docs/TESTING.md, internal/update/*test.go, pkg/ltsm/*test.go, pkg/runner_vectors_replay_test.go
The testing guide describes test suites, fixtures, platform checks, and CI coverage. A Linux crypto job runs package and LTSM tests. Shared update and LTSM helpers replace local fixtures, and the skipped runner test is removed.
sequenceDiagram
participant CLI as CLI command
participant Messaging as internal/messaging
participant Manager as session.Manager
participant Line as pkg/line Client
CLI->>Messaging: Call context-aware message operation
Messaging->>Manager: Run context-aware session operation
Manager->>Line: Dispatch context-aware API request
Line-->>Manager: Return result or context error
Manager-->>Messaging: Return operation result or error
Messaging-->>CLI: Return result or mutation detail
Loading
Merge Risk:⚪ Minimal · up to de6f3
The timeout and cancellation changes have no established merge-blocking issue. The localized guide accurately describes the new behavior.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 8.77% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 57 functions across 34 files. (9 skipped: …
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly summarizes the primary changes: fixing command cancellation behavior and organizing regression coverage.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
Docstring coverage is 8.77% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 57 functions across 34 files. (9 skipped: 9 unsupported.)
Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
Ordinary commands could continue issuing requests after cancellation, and download deadlines began after chat resolution. Carry the command context through name resolution, authentication recovery, history and key preparation, RPC dispatch, OBS token acquisition, and transfers. Add
--timeout DURATIONto whoami, contacts, chats, messages, send, download, react, and unsend; downloads retain a two-minute default that now covers preparation.Check cancellation before subsequent remote steps while preserving persisted mutation sequences and single-attempt dispatch. Confirmed send receipts and warnings about uncertain delivery, uploads, group-key registration, or already-created plaintext file messages survive signal reporting. Existing non-context API entry points remain compatibility wrappers; SIGINT/SIGTERM exit codes remain 130/143.
Organize shared test fixtures into package-local helper files, keep Linux-specific helpers separate, retire an always-skipped legacy vector replay placeholder, and add a dedicated runner/LTSM regression CI job. Update command help, the translated CLI guides, and a new contributor testing guide.
Validation:
All local checks passed using synthetic data and fake APIs. No live LINE actions were performed.
Summary
Improve command reliability with
--timeoutsupport, proper Ctrl+C cancellation, and safer handling of interrupted operations. Reorganize test helpers and expand CI coverage for encryption and signing regressions.