-
Notifications
You must be signed in to change notification settings - Fork 39.2k
Add Agent Host session configuration flow #309240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5a3a2c7
Add Agent Host session configuration flow
roblourens 8f27b03
sync
roblourens e353dd1
Merge remote-tracking branch 'origin/main' into roblou/agent-host-ses…
roblourens e99844e
Merge remote-tracking branch 'origin/roblou/agent-host-session-types'…
roblourens 2842110
Seed pending agent host session config
roblourens f47496b
Harden remote agent host session lifecycle
roblourens d4f79a2
Guard remote fork source state
roblourens 0bf615a
Revert remote agent host fork forwarding
roblourens 319b98d
Update Agent Host session config flow
roblourens 8f76635
style
roblourens 807662d
Update Agent Host branch picker filtering
roblourens cd809a2
Remove Agent Host session config icon metadata
roblourens de51c85
Address Agent Host picker review comments
roblourens 7dcf710
Merge branch 'main' into roblou/agent-host-session-config
roblourens b6a38e7
Merge remote-tracking branch 'origin/main' into roblou/agent-host-ses…
roblourens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
src/vs/platform/actionWidget/test/browser/actionList.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) Microsoft Corporation. All rights reserved. | ||
| * Licensed under the MIT License. See License.txt in the project root for license information. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| import assert from 'assert'; | ||
| import { DeferredPromise, timeout } from '../../../../base/common/async.js'; | ||
| import { CancellationToken } from '../../../../base/common/cancellation.js'; | ||
| import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js'; | ||
| import { runWithFakedTimers } from '../../../../base/test/common/timeTravelScheduler.js'; | ||
| import { IHoverService } from '../../../hover/browser/hover.js'; | ||
| import { NullHoverService } from '../../../hover/test/browser/nullHoverService.js'; | ||
| import { TestInstantiationService } from '../../../instantiation/test/common/instantiationServiceMock.js'; | ||
| import { MockKeybindingService } from '../../../keybinding/test/common/mockKeybindingService.js'; | ||
| import { IKeybindingService } from '../../../keybinding/common/keybinding.js'; | ||
| import { IOpenerService } from '../../../opener/common/opener.js'; | ||
| import { NullOpenerService } from '../../../opener/test/common/nullOpenerService.js'; | ||
| import { ActionListItemKind, ActionListWidget, IActionListItem } from '../../browser/actionList.js'; | ||
|
|
||
| interface ITestActionItem { | ||
| readonly id: string; | ||
| } | ||
|
|
||
| function action(id: string): IActionListItem<ITestActionItem> { | ||
| return { kind: ActionListItemKind.Action, label: id, item: { id } }; | ||
| } | ||
|
|
||
| function createActionListWidget(disposables: ReturnType<typeof ensureNoDisposablesAreLeakedInTestSuite>, options: { | ||
| readonly onFilter: (filter: string, cancellationToken: CancellationToken) => Promise<readonly IActionListItem<ITestActionItem>[]>; | ||
| }): ActionListWidget<ITestActionItem> { | ||
| const instantiationService = disposables.add(new TestInstantiationService()); | ||
| instantiationService.set(IKeybindingService, new MockKeybindingService()); | ||
| instantiationService.set(IHoverService, NullHoverService); | ||
| instantiationService.set(IOpenerService, NullOpenerService); | ||
|
|
||
| const widget = disposables.add(instantiationService.createInstance( | ||
| ActionListWidget<ITestActionItem>, | ||
| 'testActionList', | ||
| false, | ||
| [action('initial')], | ||
| { | ||
| onHide: () => { }, | ||
| onSelect: () => { }, | ||
| onFilter: options.onFilter, | ||
| }, | ||
| undefined, | ||
| { showFilter: true }, | ||
| )); | ||
|
|
||
| if (widget.filterContainer) { | ||
| document.body.appendChild(widget.filterContainer); | ||
| disposables.add({ dispose: () => widget.filterContainer?.remove() }); | ||
| } | ||
| document.body.appendChild(widget.domNode); | ||
| disposables.add({ dispose: () => widget.domNode.remove() }); | ||
| widget.layout(200, 200); | ||
|
|
||
| return widget; | ||
| } | ||
|
|
||
| function typeFilter(widget: ActionListWidget<ITestActionItem>, value: string): void { | ||
| assert.ok(widget.filterInput); | ||
| widget.filterInput.value = value; | ||
| widget.filterInput.dispatchEvent(new Event('input')); | ||
| } | ||
|
|
||
| suite('ActionListWidget', () => { | ||
| const disposables = ensureNoDisposablesAreLeakedInTestSuite(); | ||
|
|
||
| test('runs dynamic filter updates immediately', () => runWithFakedTimers({ useFakeTimers: true }, async () => { | ||
| const filters: string[] = []; | ||
| const widget = createActionListWidget(disposables, { | ||
| onFilter: async filter => { | ||
| filters.push(filter); | ||
| return [action(`${filter}-result`)]; | ||
| }, | ||
| }); | ||
|
|
||
| typeFilter(widget, 'm'); | ||
| typeFilter(widget, 'ma'); | ||
| assert.deepStrictEqual(filters, ['m', 'ma']); | ||
| await timeout(0); | ||
| assert.ok(widget.domNode.textContent?.includes('ma-result')); | ||
| })); | ||
|
|
||
| test('ignores stale dynamic filter results', async () => { | ||
| const firstResult = new DeferredPromise<readonly IActionListItem<ITestActionItem>[]>(); | ||
| const secondResult = new DeferredPromise<readonly IActionListItem<ITestActionItem>[]>(); | ||
| const filters: string[] = []; | ||
| const widget = createActionListWidget(disposables, { | ||
| onFilter: filter => { | ||
| filters.push(filter); | ||
| return filter === 'm' ? firstResult.p : secondResult.p; | ||
| }, | ||
| }); | ||
|
|
||
| typeFilter(widget, 'm'); | ||
| typeFilter(widget, 'ma'); | ||
| assert.deepStrictEqual(filters, ['m', 'ma']); | ||
|
|
||
| firstResult.complete([action('ma-stale-result')]); | ||
| await timeout(0); | ||
| assert.ok(!widget.domNode.textContent?.includes('ma-stale-result')); | ||
|
|
||
| secondResult.complete([action('ma-fresh-result')]); | ||
| await timeout(0); | ||
| assert.ok(widget.domNode.textContent?.includes('ma-fresh-result')); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 1f72258 | ||
| 7c0c693 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.