Skip to content

Conversation

@nowgnuesLee
Copy link
Contributor

@nowgnuesLee nowgnuesLee commented Sep 19, 2025

resolves #4256 (FR-1448)

This PR adds support for selecting multiple agents when launching a session, available for Backend.AI manager version 25.15.0 and above.

Key changes:

  • Modified AgentSelect component to handle multiple agent selection
  • Updated agent selection logic in ResourceAllocationFormItems to support multi-agent mode
  • Added special handling for the "auto" option in multi-select mode
  • Implemented proper agent_list generation in session creation payload
  • Added 'multi-agents' feature detection for manager version 25.16.0+
  • Changed agent default value from string to array format ['auto']
  • Removed restrictions that previously disabled cluster settings when a specific agent was selected

for testing, using test server which supports multi node session(like dogbowl)
Prior to version 25.16.0, it must behave identically to the existing version.

how to test:

  • single mode
    • Please verify that the agent_list is sent as a string[] when using multi-agents.
  • multi mode
    • Please verify that the agent_list is being passed as a string array when using multi-agents.

CleanShot 2025-09-19 at 17.15.50@2x.png

CleanShot 2025-09-19 at 17.15.30@2x.png

CleanShot 2025-11-13 at 10.39.50@2x.png

Checklist:

  • Documentation
  • Minium required manager version: 25.16.0
  • Specific setting for review
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

@github-actions github-actions bot added area:lib Library and SDK related issue. size:M 30~100 LoC labels Sep 19, 2025
Copy link
Contributor Author

nowgnuesLee commented Sep 19, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@nowgnuesLee nowgnuesLee marked this pull request as ready for review September 19, 2025 08:19
Copilot AI review requested due to automatic review settings September 19, 2025 08:19
@nowgnuesLee nowgnuesLee force-pushed the feat/select-multi-agents branch from 98e011d to 589e38d Compare September 19, 2025 08:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables multi-agent selection when creating multi-node sessions for Backend.AI manager version 25.15.0 and above. It transforms the agent selection from a single dropdown to a multi-select component while maintaining backward compatibility.

  • Added 'multi-agents' feature detection for manager version 25.15.0+
  • Modified AgentSelect component to support multiple agent selection with special "auto" handling
  • Updated session creation payload logic to properly handle agent arrays and cluster size requirements

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/lib/backend.ai-client-esm.ts Added feature flag detection for multi-agents support
react/src/pages/SessionLauncherPage.tsx Updated session creation payload logic and default agent value format
react/src/components/ResourceAllocationFormItems.tsx Modified form to support multi-agent selection and removed cluster restrictions
react/src/components/AgentSelect.tsx Enhanced component to handle multiple selection with auto option logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

github-actions bot commented Sep 19, 2025

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
4.64% (-0.15% 🔻)
530/11414
🔴 Branches
3.73% (-0.16% 🔻)
302/8088
🔴 Functions
2.88% (-0.06% 🔻)
102/3539
🔴 Lines
4.59% (-0.15% 🔻)
512/11158
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / graphql-transformer.ts
82.26% (-4.92% 🔻)
79.41% (-5.2% 🔻)
71.43% (-3.57% 🔻)
83.61% (-4.71% 🔻)
🔴
... / AgentSelect.tsx
3.7% (-1.3% 🔻)
0% 0%
3.7% (-1.3% 🔻)
🔴
... / ResourceAllocationFormItems.tsx
13.81% (-0.06% 🔻)
9.46% (-0.34% 🔻)
12% (-0.16% 🔻)
13.56% (-0.06% 🔻)

Test suite run success

121 tests passing in 14 suites.

Report generated by 🧪jest coverage report action from 5313409

Copy link
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

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

please resolve the conflicts :)

Copy link
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

Code improvements

1. ResourceAllocationFormItems.tsx

  • Improved code readability by removing spread operator and passing props directly
  • mode and labelRender props are now more explicitly defined

2. SessionLauncherPage.tsx

  • Simplified array handling by replacing Array.isArray() check with _.castArray()
  • Better utilization of lodash utility function for cleaner code

@yomybaby yomybaby force-pushed the feat/select-multi-agents branch 2 times, most recently from a30d7fe to f0ef289 Compare October 1, 2025 06:52
Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

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

please resolve the conflicts. and is there any test node? you can reply it in jira comment or teams.

@nowgnuesLee nowgnuesLee force-pushed the feat/select-multi-agents branch from f0ef289 to 9dafe79 Compare November 7, 2025 07:59
@github-actions github-actions bot added size:L 100~500 LoC and removed size:M 30~100 LoC labels Nov 7, 2025
@nowgnuesLee nowgnuesLee force-pushed the feat/select-multi-agents branch from 9dafe79 to 7b6d945 Compare November 7, 2025 08:14
@github-actions github-actions bot added size:M 30~100 LoC and removed size:L 100~500 LoC labels Nov 7, 2025
@nowgnuesLee nowgnuesLee marked this pull request as draft November 10, 2025 05:24
@nowgnuesLee nowgnuesLee force-pushed the feat/select-multi-agents branch from 7b6d945 to 9a85373 Compare November 10, 2025 06:57
@nowgnuesLee nowgnuesLee marked this pull request as ready for review November 10, 2025 07:01
@nowgnuesLee nowgnuesLee force-pushed the feat/select-multi-agents branch from 9a85373 to f8713f6 Compare November 10, 2025 07:16
Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

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

How about dealing with only array of agents for reducing redundant checking? I think most of default values are already array.

@nowgnuesLee nowgnuesLee force-pushed the feat/select-multi-agents branch from f8713f6 to 4d0c039 Compare November 12, 2025 11:25
@agatha197 agatha197 requested a review from Copilot November 13, 2025 00:34
Copilot finished reviewing on behalf of agatha197 November 13, 2025 00:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

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

image.png

It needs to handle resource allocation also when user set multiple agent.

@nowgnuesLee nowgnuesLee force-pushed the feat/select-multi-agents branch from 4d0c039 to 5313409 Compare November 13, 2025 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:lib Library and SDK related issue. size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User want to select multiple agents when creating a multi-node session.

5 participants