877
const liveSummary = this._stateManager.getSessionSummary(s.session.toString());
878
if (liveSummary) {
879
>
// Overlay the live `_meta` over the DB-derived value. The live
agentService.ts
880
>
// `_meta` is the freshest source (e.g. the GitHub state is
881
>
// published here as soon as a PR is created), so a freshly-created
882
>
// session that has not yet persisted its state to its session
883
>
// database still reports it here. Keep the DB value as the base so
884
>
// any keys absent from the live `_meta` are preserved.
885
>
const _meta = liveSummary._meta !== undefined || s._meta !== undefined
886
? { ...s._meta, ...liveSummary._meta }
887
: undefined;
888
>
const liveWorkingDir = liveSummary.workingDirectories?.[0];
agentService.ts
889
>
return {
890
>
...s,
891
>
summary: liveSummary.title || s.summary,
892
>
status: liveSummary.status,
893
>
activity: liveSummary.activity,
894
>
modifiedTime: Date.parse(liveSummary.modifiedAt),
895
>
project: liveSummary.project
896
>
? { uri: URI.parse(liveSummary.project.uri), displayName: liveSummary.project.displayName }
897
: s.project,
899
? URI.parse(liveWorkingDir)
900
: s.workingDirectory,
902
>
changesets: this._stateManager.getSessionState(s.session.toString())?.changesets ?? s.changesets,
903
>
...(_meta !== undefined ? { _meta } : {}),
904
>
};
905
>
}
906
return s;
907
});