Skip to content

Allow direct AgentSession kwargs in AgentPool.add and merge with session_kwargs#7

Merged
mahimairaja merged 1 commit intomainfrom
feat/update-agentpool.add-for-session_kwargs-support-iyg8gi
Mar 19, 2026
Merged

Allow direct AgentSession kwargs in AgentPool.add and merge with session_kwargs#7
mahimairaja merged 1 commit intomainfrom
feat/update-agentpool.add-for-session_kwargs-support-iyg8gi

Conversation

@mahimairaja
Copy link
Copy Markdown
Collaborator

Motivation

  • Make the public AgentPool.add() API support the Milestone 3 contract where callers can pass AgentSession options directly as keyword arguments while preserving the existing session_kwargs mapping.
  • Preserve backward compatibility and provide an explicit precedence rule so callers know how conflicting options are resolved.

Description

  • Added **session_options to AgentPool.add() so callers may pass AgentSession options directly to add().
  • Replaced the old _copy_session_kwargs helper with _merge_session_kwargs(session_kwargs, direct_session_kwargs) which merges the mapping and direct kwargs with direct kwargs taking precedence.
  • AgentConfig.session_kwargs is now stored as the merged dict so runtime session creation receives the combined, precedence-resolved options.
  • Updated docstrings and README.md to document the new calling style and precedence, and added a README example showing mixed usage.
  • Added two tests: test_add_merges_direct_session_kwargs_with_mapping in tests/test_pool.py and test_handle_session_supports_direct_session_kwargs in tests/test_routing.py to cover storage and runtime behavior for direct kwargs and precedence.

Testing

  • Ran pytest tests/test_pool.py tests/test_routing.py and all tests passed (24 passed).
  • Ran python -m compileall src tests and compilation succeeded without errors.

Codex Task

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 19, 2026

Warning

Rate limit exceeded

@mahimairaja has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 52 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ab4e7292-ee1d-4e34-ada7-1be08367469a

📥 Commits

Reviewing files that changed from the base of the PR and between 26b6c11 and e742664.

📒 Files selected for processing (4)
  • README.md
  • src/openrtc/pool.py
  • tests/test_pool.py
  • tests/test_routing.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/update-agentpool.add-for-session_kwargs-support-iyg8gi
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mahimairaja mahimairaja merged commit d6bf99f into main Mar 19, 2026
6 checks passed
@mahimairaja mahimairaja deleted the feat/update-agentpool.add-for-session_kwargs-support-iyg8gi branch March 23, 2026 17:07
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.

1 participant