Add logging for repository name resolution in AgentSessionsDataSource and AgentSessionsControl

This commit is contained in:
Osvaldo Ortega
2026-03-13 13:09:38 -07:00
parent b6c2e2e6f0
commit 5ad2b7fcd1
2 changed files with 12 additions and 1 deletions
@@ -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;