Skip to content

feature: enable cmd timeout flag#43

Merged
tschaefer merged 1 commit intomainfrom
tschaefer/feature/cmd-timeout
Feb 23, 2026
Merged

feature: enable cmd timeout flag#43
tschaefer merged 1 commit intomainfrom
tschaefer/feature/cmd-timeout

Conversation

@tschaefer
Copy link
Owner

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request enables a configurable command timeout flag for SSH operations, replacing the previous hardcoded 300-second timeout. The changes introduce context-based timeout management throughout the codebase, allowing users to customize timeout behavior via a --run.cmd-timeout flag.

Changes:

  • Added --run.cmd-timeout flag (default: 300 seconds) to control SSH command and copy operation timeouts
  • Refactored Target interface to accept context parameters for Run and Copy operations
  • Introduced Options struct pattern for constructor parameters across target, service, and agent packages
  • Added context propagation from root command through all service and agent operations
  • Improved error handling for JSON marshaling operations

Reviewed changes

Copilot reviewed 49 out of 49 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
cmd/root.go Added persistent --run.cmd-timeout flag and signal-based context cancellation
internal/target/target.go Updated Target interface to accept context, introduced Options struct, renamed NewTarget to New
internal/target/local.go Updated to use context-based timeouts for local command execution
internal/target/remote.go Updated to use context-based timeouts for remote SSH operations
internal/service/service.go Added context field and Options struct for service configuration
internal/agent/agent.go Added context field and Options struct for agent configuration
cmd/service/*.go Updated all service commands to pass timeout via Options
cmd/agent/*.go Updated all agent commands to pass timeout via Options
internal/service/*.go Updated all service operations to use context from service instance
internal/agent/*.go Updated all agent operations to use context from agent instance
*_test.go Updated tests to use new API with Options struct and context
cmd/errors/errors.go Added error handling for JSON marshaling failures

@tschaefer tschaefer force-pushed the tschaefer/feature/cmd-timeout branch 2 times, most recently from 336ec07 to 9339040 Compare February 22, 2026 12:16
@tschaefer tschaefer force-pushed the tschaefer/feature/cmd-timeout branch from 9339040 to 0e5ba1e Compare February 22, 2026 19:56
@tschaefer tschaefer marked this pull request as ready for review February 22, 2026 20:10
@tschaefer tschaefer merged commit ca7cee2 into main Feb 23, 2026
2 checks passed
@tschaefer tschaefer deleted the tschaefer/feature/cmd-timeout branch February 23, 2026 18:39
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