( config: ToolConfiguration, runId: string, createdAtMs: number )
| 87 | * and the history scan fallback can still re-establish provenance for the current context epoch. |
| 88 | */ |
| 89 | export async function recordBackgroundWorkflowRunReference( |
| 90 | config: ToolConfiguration, |
| 91 | runId: string, |
| 92 | createdAtMs: number |
| 93 | ): Promise<void> { |
| 94 | const workspaceSessionDir = config.workspaceSessionDir; |
| 95 | if (workspaceSessionDir == null || workspaceSessionDir.length === 0) { |
| 96 | log.warn("Skipping agent workflow run reference without workspace session dir", { runId }); |
| 97 | return; |
| 98 | } |
| 99 | |
| 100 | try { |
| 101 | await recordAgentWorkflowRunReference({ workspaceSessionDir, runId, createdAtMs }); |
| 102 | } catch (error: unknown) { |
| 103 | log.warn("Failed to record agent workflow run reference", { |
| 104 | runId, |
| 105 | error: getErrorMessage(error), |
| 106 | }); |
| 107 | } |
| 108 | } |
no test coverage detected