{"record":{"id":"e1d3604564662c87","repo":"deepseek-ai/deepseek-harness","slug":"subagent-activation-childid-best-effort-final","errorCode":null,"errorMessage":"subagent \"${activation.childId}\" best-effort final session flush failed; the persisted state may be unavailable or stale on resume: ${errorChain(error)}","messagePattern":"subagent \"(.+?)\" best-effort final session flush failed; the persisted state may be unavailable or stale on resume: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/subagent/subagent/src/continuation.ts","lineNumber":1524,"sourceCode":"      this.ctx.logger.warn(\n        `subagent \"${activation.childId}\" settlement notice was not delivered to its parent: `\n        + errorChain(error),\n      )\n    }\n  }\n\n  /**\n   * Request a best-effort final session flush after the child is quiescent.\n   * Listener failure is logged because flush participation cannot identify a\n   * particular persistence backend, and teardown must still release ownership.\n   * @param activation - the Activation whose final events should be flushed.\n   */\n  private async flushFinalState(activation: Activation): Promise<void> {\n    const child = activation.handle.agent\n    try {\n      await child.ctx.sessions.flush(child.session)\n    } catch (error: unknown) {\n      this.ctx.logger.warn(\n        `subagent \"${activation.childId}\" best-effort final session flush failed; `\n        + `the persisted state may be unavailable or stale on resume: ${errorChain(error)}`,\n      )\n    }\n  }\n\n  /** Resolve the persistence service continuable children require, or fail loud. */\n  private requirePersistence(): SessionPersistence {\n    const persistence = this.ctx.get('sessionPersistence')\n    if (persistence === undefined) {\n      throw new SubagentError(\n        'continuable subagents require session persistence (load a dsh-session-persistence backend)',\n        'PERSISTENCE_UNAVAILABLE',\n      )\n    }\n    return persistence\n  }\n}","sourceCodeStart":1506,"sourceCodeEnd":1542,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/subagent/subagent/src/continuation.ts#L1506-L1542","documentation":"Error \"subagent \"${activation.childId}\" best-effort final session flush failed; the persisted state may be unavailable or stale on resume: ${errorChain(error)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/subagent/subagent/src/continuation.ts:1524 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify session persistence storage is writable; on resume expect stale state and re-run the flush or the child task."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}