Skip to content

Conversation

pedroslopez
Copy link
Contributor

@pedroslopez pedroslopez commented Sep 23, 2025

What

When wiring up evals, we want to be able to run multiple "sessions" or connector builds within the same python process. The current structure makes this hard, since we use global variables to keep track of a few things, such as which directory we're writing to.

This PR refactors this "global state" that is relevant for a specific run of the agent into a SessionState that is passed around, in order to be able to call the method to run the agent multiple times within the same python process.

Note: most of this was done by Claude Code

How

  • Introduce SessionState
  • Move workspace_dir, execution_log_file, is_success, is_failed, start_time into the session state
  • Rather than creating tools at a global level, which can have information such as which directory we're writing to in the case of the files tool, refactor into methods that create the tool, and uses it in the context of a particular session.
  • Expose session_id as a parameter to the run_connector_build method. This is so we can explicitly pass a session ID to better control where things will be stored, allowing us to reference the workspace directory after the fact.

@github-actions github-actions bot added the chore label Sep 23, 2025
Copy link

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

Testing This Branch via MCP

To test the changes in this specific branch with an MCP client like Claude Desktop, use the following configuration:

{
  "mcpServers": {
    "connector-builder-mcp-dev": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/airbytehq/connector-builder-mcp.git@pedro/no-globals", "connector-builder-mcp"]
    }
  }
}

Testing This Branch via CLI

You can test this version of the MCP Server using the following CLI snippet:

# Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/connector-builder-mcp.git@pedro/no-globals#egg=airbyte-connector-builder-mcp' --help

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poe <command> - Runs any poe command in the uv virtual environment
  • /poe build-connector prompt="Star Wars API" - Run the connector builder using the Star Wars API.

📝 Edit this welcome message.

Copy link

github-actions bot commented Sep 23, 2025

PyTest Results (Fast)

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 295aa4d. ± Comparison against base commit b03e56f.

♻️ This comment has been updated with latest results.

# Conflicts:
#	connector_builder_agents/src/run.py
@pedroslopez pedroslopez marked this pull request as ready for review September 26, 2025 15:32
Copy link
Contributor

@aaronsteers aaronsteers left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit:

@pedroslopez pedroslopez merged commit 6624d45 into main Sep 30, 2025
25 of 27 checks passed
@pedroslopez pedroslopez deleted the pedro/no-globals branch September 30, 2025 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🧪 Tests: Implement an evals framework to measure success and performance

2 participants