-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Error when calling Goose CLI with session resume from Python subprocess #6236
Description
Describe the bug
When I call goose CLI (non-interactive) with -r flag (resuming session) from python subprocess, it results in this error:
result = subprocess.run(
['goose', 'run', '--output-format', 'json', '-n', 'test_goosebud', '-r', '-t', 'hi goose?', '--max-turns', '1'],
# input=input_text,
text=True,
capture_output=True
)
(subprocess result):
CompletedProcess(args=['goose', 'run', '--output-format', 'json', '-n', 'test_goosebud', '-r', '-t', 'hi goose', '--max-turns', '1'], returncode=3221226505, stdout='', stderr="\nthread 'main' panicked at /usr/src/myapp/crates/goose-cli/src/session/builder.rs:387:33:\nFailed to get user input: Kind(NotConnected)\nnote: run with RUST_BACKTRACE=1 environment variable to display a backtrace\n")
Goose error:
"\nthread 'main' panicked at /usr/src/myapp/crates/goose-cli/src/session/builder.rs:387:33:\nFailed to get user input: Kind(NotConnected)\nnote: run with RUST_BACKTRACE=1 environment variable to display a backtrace\n"
To Reproduce
Steps to reproduce the behavior:
Step 1 - Have goose CLI configured
Step 2 - Create a named session (here, test_resume_session)
Step 2 - In python script, run:
result = subprocess.run(
['goose', 'run', '--output-format', 'json', '-n', 'test_resume_session', '-r', '-t', 'hi goose for testing', '--max-turns', '1'],
text=True,
capture_output=True
)
Expected behavior
(worked before updating. I don't remember the initial version, sorry)
Please provide the following information
- OS & Arch: [Windows 11 x64]
- Interface: [CLI]
- Version: [ 1.14.0]
- Extensions enabled: []
- Provider & Model: []
Additional context