mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-08 15:55:15 +01:00
Add logging for repository name resolution in AgentSessionsDataSource and AgentSessionsControl
This commit is contained in:
@@ -42,6 +42,7 @@ import { ChatEditorInput } from '../widgetHosts/editor/chatEditorInput.js';
|
||||
import { IMouseEvent } from '../../../../../base/browser/mouseEvent.js';
|
||||
import { IChatWidget } from '../chat.js';
|
||||
import { IStorageService, StorageScope, StorageTarget } from '../../../../../platform/storage/common/storage.js';
|
||||
import { ILogService } from '../../../../../platform/log/common/log.js';
|
||||
|
||||
export interface IAgentSessionsControlOptions extends IAgentSessionsSorterOptions {
|
||||
readonly overrideStyles: IStyleOverride<IListStyles>;
|
||||
@@ -108,6 +109,7 @@ export class AgentSessionsControl extends Disposable implements IAgentSessionsCo
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@IStorageService private readonly storageService: IStorageService,
|
||||
@ILogService private readonly logService: ILogService,
|
||||
) {
|
||||
super();
|
||||
|
||||
@@ -248,7 +250,7 @@ export class AgentSessionsControl extends Disposable implements IAgentSessionsCo
|
||||
...this.options,
|
||||
isGroupedByRepository: () => this.options.filter.groupResults?.() === AgentSessionsGrouping.Repository,
|
||||
}, approvalModel, activeSessionResource));
|
||||
const sessionFilter = this._register(new AgentSessionsDataSource(this.options.filter, sorter));
|
||||
const sessionFilter = this._register(new AgentSessionsDataSource(this.options.filter, sorter, this.logService));
|
||||
const list = this.sessionsList = this._register(this.instantiationService.createInstance(WorkbenchCompressibleAsyncDataTree,
|
||||
'AgentSessionsView',
|
||||
container,
|
||||
|
||||
@@ -49,6 +49,7 @@ import { Button } from '../../../../../base/browser/ui/button/button.js';
|
||||
import { defaultButtonStyles } from '../../../../../platform/theme/browser/defaultStyles.js';
|
||||
import { AgentSessionApprovalModel } from './agentSessionApprovalModel.js';
|
||||
import { BugIndicatingError } from '../../../../../base/common/errors.js';
|
||||
import { ILogService } from '../../../../../platform/log/common/log.js';
|
||||
|
||||
|
||||
export type AgentSessionListItem = IAgentSession | IAgentSessionSection;
|
||||
@@ -751,6 +752,7 @@ export class AgentSessionsDataSource extends Disposable implements IAsyncDataSou
|
||||
constructor(
|
||||
private readonly filter: IAgentSessionsFilter | undefined,
|
||||
private readonly sorter: ITreeSorter<IAgentSession>,
|
||||
private readonly logService?: ILogService,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@@ -884,6 +886,13 @@ export class AgentSessionsDataSource extends Disposable implements IAsyncDataSou
|
||||
}
|
||||
|
||||
const repoName = this.getRepositoryName(session);
|
||||
if (!repoName) {
|
||||
this.logService?.warn('[AgentSessions] Could not determine repository name for session, categorizing as "Other"', {
|
||||
resource: session.resource.toString(),
|
||||
badge: session.badge ? (typeof session.badge === 'string' ? session.badge : session.badge.value) : undefined,
|
||||
metadata: session.metadata,
|
||||
});
|
||||
}
|
||||
const repoId = repoName || unknownKey;
|
||||
const repoLabel = repoName || unknownLabel;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user