Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Real-Time SSH Command Output Streaming #3

Open
zjasper666 opened this issue Dec 15, 2024 · 0 comments
Open

Implement Real-Time SSH Command Output Streaming #3

zjasper666 opened this issue Dec 15, 2024 · 0 comments

Comments

@zjasper666
Copy link
Collaborator

Overview

Currently, the SSH command execution waits for the entire command to complete before returning the output. This can be problematic for long-running commands or when real-time feedback is needed. We need to implement streaming output functionality for remote SSH command execution.

Current Implementation

The current implementation in SSHManager.execute():

  • Uses Paramiko's exec_command()
  • Waits for command completion
  • Returns complete output as a single string
  • No progress visibility during execution

Proposed Changes

  1. Core SSH Manager Updates

    • Modify execute() to support streaming mode
    • Implement generator-based output streaming
    • Add buffer size configuration
    • Handle both stdout and stderr streams
  2. API Changes

    • Add streaming parameter to RemoteShellInput
    • Update return type to support both string and generator modes
    • Implement progress callbacks
    • Add timeout configuration
  3. UI/UX Improvements

    • Real-time output display in terminal
    • Progress indication for long-running commands
    • Color-coded output (stdout vs stderr)
    • Support for command interruption
  4. Langchain Integration

    • Update HyperbolicTool to support streaming outputs
    • Implement Langchain streaming callbacks
    • Integrate with Langchain's streaming interfaces
    • Support async execution in Langchain agent
    • Add streaming support to HyperbolicAgentkitWrapper

Success Criteria

  • Real-time output streaming for remote commands
  • Minimal latency between command execution and output display
  • Proper error handling and status reporting
  • Backward compatibility with existing code
  • Documentation for new streaming features

Testing Requirements

  1. Unit Tests

    • Test streaming functionality
    • Verify error handling
    • Check timeout behavior
    • Test large output handling
  2. Integration Tests

    • Test with various command types
    • Verify real-world performance
    • Test interruption handling
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

No branches or pull requests

1 participant