Skip to content

fix: bound Composio startup and forward Compose API key - #156

Open
Twil3akine wants to merge 2 commits into
CopilotKit:mainfrom
Twil3akine:fix/issue-152-composio-startup-cancellation-and-compose-key
Open

Twil3akine wants to merge 2 commits into
CopilotKit:mainfrom
Twil3akine:fix/issue-152-composio-startup-cancellation-and-compose-key

Conversation

@Twil3akine

Copy link
Copy Markdown
Contributor

Fixes #152.

Summary

Make Composio startup respect Dot run cancellation and timeouts, and forward COMPOSIO_API_KEY into Docker Compose deployments.

Cause

Composio session creation/reuse and tool discovery ran before the inner agent started, but those requests did not receive the Dot run's abort signal.

If either startup request stalled, the turn timeout aborted the controller without settling the pending startup work, leaving the run stream open until that request eventually returned.

Separately, the server reads COMPOSIO_API_KEY, but compose.yml did not pass the value into the app container.

Fix

  • Pass the Dot run abort signal to Composio session creation and session reuse.
  • Pass the same signal to Composio tool discovery.
  • Complete timed-out runs while Composio startup is still pending.
  • Stop startup after explicit cancellation so the inner agent cannot begin later if the pending session request resolves.
  • Preserve the existing behavior once normal agent execution has started.
  • Forward optional COMPOSIO_API_KEY through the app service in compose.yml.

Regression coverage

Added coverage for:

  • a stalled Composio session request reaching the turn timeout;
  • stalled Composio tool discovery reaching the turn timeout;
  • cancellation before session creation resolves;
  • propagation of the abort signal through Composio SDK request options;
  • Compose forwarding of COMPOSIO_API_KEY.

The integration remains optional: when connected apps are disabled or no Composio key is configured, existing behavior is unchanged.

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.

Composio follow-up: bound startup cancellation and forward Compose API key

1 participant