Skip to content

Agent sessions: provide inProgressTime and finishedOrFailedTime from provider #278567

@bpasero

Description

@bpasero

Usecase: show how long the current task is running (if in-progress) and when the last response finished.

Today we do tracking of these properties in-memory:

// State + Timings
// TODO@bpasero this is a workaround for not having precise timing info in sessions
// yet: we only track the time when a transition changes because then we can say with
// confidence that the time is correct by assuming `Date.now()`. A better approach would
// be to get all this information directly from the session.
const status = session.status ?? ChatSessionStatus.Completed;
const state = this.mapSessionToState.get(session.resource);
let inProgressTime = state?.inProgressTime;
let finishedOrFailedTime = state?.finishedOrFailedTime;

We need to get this data from the provider to show it properly. This needs support for that info from the provider API.

//cc @mjbvz @osortega @rebornix @DonJayamanne

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions