{"record":{"id":"f0dc2d5096ef2631","repo":"deepseek-ai/deepseek-harness","slug":"already-in-flight","errorCode":"ALREADY_IN_FLIGHT","errorMessage":"an authorization attempt for \"${key}\" is already running","messagePattern":"an authorization attempt for \"(.+?)\" is already running","errorType":"error_code","errorClass":"AuthorizationError","httpStatus":null,"severity":"error","filePath":"packages/credentials/authorization/src/index.ts","lineNumber":287,"sourceCode":"   * @throws {AuthorizationError} code `NO_FLOW` when nothing claims the key,\n   *   `UNKNOWN_METHOD` when the named method is not one the flow offers,\n   *   `ALREADY_IN_FLIGHT` when an attempt is already running for the key, or\n   *   `NOT_COMMITTED` when the flow resolved without committing a record\n   *   during the attempt.\n   */\n  async begin(request: AuthorizationRequest): Promise<AuthorizationOutcome> {\n    const { key } = request\n    const flow = this.flows.get(key)\n    if (flow === undefined) {\n      throw new AuthorizationError(`no authorization flow is registered for \"${key}\"`, 'NO_FLOW')\n    }\n    const method = request.method ?? flow.methods[0].id\n    if (!flow.methods.some(candidate => candidate.id === method)) {\n      throw new AuthorizationError(\n        `authorization flow for \"${key}\" offers no method \"${method}\"`, 'UNKNOWN_METHOD')\n    }\n    if (this.running.has(key)) {\n      throw new AuthorizationError(\n        `an authorization attempt for \"${key}\" is already running`, 'ALREADY_IN_FLIGHT')\n    }\n    // Withdrawn before it began: never claim the slot and never run the flow.\n    // Handing an aborted signal to `run()` would rely on every flow checking it\n    // before its first await, and one that does not would hang holding the key.\n    // Validation still runs first, so a caller naming a key or method that does\n    // not exist hears about it whether or not it also gave up.\n    if (request.signal?.aborted === true) return { status: 'cancelled' }\n    const controller = new AbortController()\n    const withdraw = (): void => { controller.abort(request.signal?.reason) }\n    request.signal?.addEventListener('abort', withdraw, { once: true })\n    this.running.set(key, { controller })\n    let settlement: AuthorizationSettlement = 'failed'\n    try {\n      const outcome = await this.attempt(flow, method, controller.signal, request.interaction)\n      settlement = outcome.status\n      return outcome\n    } finally {","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/credentials/authorization/src/index.ts#L269-L305","documentation":"Error \"an authorization attempt for \"${key}\" is already running\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/credentials/authorization/src/index.ts:287 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}