Skip to content

Can now specify secrets on conversation start, and simplified type hints#625

Merged
tofarr merged 3 commits intomainfrom
include-secrets-in-conversation-start
Oct 3, 2025
Merged

Can now specify secrets on conversation start, and simplified type hints#625
tofarr merged 3 commits intomainfrom
include-secrets-in-conversation-start

Conversation

@tofarr
Copy link
Collaborator

@tofarr tofarr commented Oct 3, 2025

Changes

  • Add secrets parameter to conversation start: Both LocalConversation and RemoteConversation now accept a secrets parameter during initialization
  • Update agent server models: Added secrets field to StartConversationRequest for remote conversation support
  • Improve type hints: Changed dict[str, SecretValue] to Mapping[str, SecretValue] for better type safety and flexibility
  • Pass secrets to event service: Agent server now properly forwards secrets when starting conversations

Impact

Enables users to provide secrets at conversation start time instead of requiring a separate update_secrets() call, improving the developer experience for both local and remote conversations.


Agent Server images for this PR

GHCR package: https://github.com/All-Hands-AI/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Base Image Docs / Tags
golang golang:1.21-bookworm Link
java eclipse-temurin:17-jdk Link
python nikolaik/python-nodejs:python3.12-nodejs22 Link

Pull (multi-arch manifest)

docker pull ghcr.io/all-hands-ai/agent-server:26a0fd6-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-26a0fd6-python \
  ghcr.io/all-hands-ai/agent-server:26a0fd6-python

All tags pushed for this build

ghcr.io/all-hands-ai/agent-server:26a0fd6-golang
ghcr.io/all-hands-ai/agent-server:v1.0.0_golang_tag_1.21-bookworm_golang
ghcr.io/all-hands-ai/agent-server:26a0fd6-java
ghcr.io/all-hands-ai/agent-server:v1.0.0_eclipse-temurin_tag_17-jdk_java
ghcr.io/all-hands-ai/agent-server:26a0fd6-python
ghcr.io/all-hands-ai/agent-server:v1.0.0_nikolaik_s_python-nodejs_tag_python3.12-nodejs22_python

The 26a0fd6 tag is a multi-arch manifest (amd64/arm64); your client pulls the right arch automatically.

@tofarr tofarr changed the title Added ability to specify secrets on conversation start and simplified… Can now specify secrets on conversation start, and simplified type hints Oct 3, 2025
tofarr and others added 2 commits October 2, 2025 20:20
- Added test_start_conversation_with_secrets to verify secrets are passed to new conversations
- Added test_start_conversation_without_secrets to verify default behavior
- Updated conversation_service fixture to use temporary directories for test isolation
- Tests verify that StaticSecret objects are properly passed through the conversation creation flow

Co-authored-by: openhands <openhands@all-hands.dev>
Copy link
Collaborator

@malhotra5 malhotra5 left a comment

Choose a reason for hiding this comment

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

LGTM!

@tofarr tofarr merged commit 519434b into main Oct 3, 2025
16 checks passed
@tofarr tofarr deleted the include-secrets-in-conversation-start branch October 3, 2025 04:10
neubig pushed a commit that referenced this pull request Feb 11, 2026
When libtmux's new_session() returns a Session with session_id=None
(due to a bug in parse_output() not handling fewer output values),
we now retry fetching the session from server.sessions.

This is a workaround for the issue where neubig's fix PR #625 doesn't
fully handle cases where tmux returns fewer than the expected 125
format field values, causing the zip() to truncate before reaching
session_id at index 92.

The workaround:
1. Check if session_id is None after new_session()
2. If so, retry up to 3 times with increasing delays
3. Fetch the session by name from server.sessions
4. Raise a clear error if all retries fail

See: tmux-python/libtmux#624

Co-authored-by: openhands <openhands@all-hands.dev>
neubig pushed a commit that referenced this pull request Feb 11, 2026
Improved the workaround for the libtmux race condition where
new_session() returns a Session with session_id=None.

Changes:
- Wrap entire session creation in retry loop (up to 5 attempts)
- Try to get session from server.sessions if session_id is None
- Add increasing delays between retries
- Clean up orphan sessions before retry
- Better error messages with last error included

The root issue is that neubig's PR #625 fix tries to parse 125+
format fields from tmux output, but tmux may not output all fields
in some environments (especially Python 3.13 + PyInstaller + Docker),
causing session_id (at index 92) to be missing from the parsed output.

Co-authored-by: openhands <openhands@all-hands.dev>
neubig pushed a commit that referenced this pull request Feb 11, 2026
The libtmux fix (neubig's PR #625) uses a format string with 125+ fields,
but tmux may not output all fields correctly in some environments
(Python 3.13 + PyInstaller + Docker), causing session_id (at index 92)
to be missing from the parsed output.

This adds a fallback that directly queries tmux using a simple format
string ('#{session_id}:#{session_name}') to get the session_id when
libtmux's complex format parsing fails.

Co-authored-by: openhands <openhands@all-hands.dev>
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.

3 participants

Comments