{"record":{"id":"0f5ded7c5234230d","repo":"deepseek-ai/deepseek-harness","slug":"duplicate-flow","errorCode":"DUPLICATE_FLOW","errorMessage":"an authorization flow for \"${flow.key}\" is already registered","messagePattern":"an authorization flow for \"(.+?)\" is already registered","errorType":"error_code","errorClass":"AuthorizationError","httpStatus":null,"severity":"error","filePath":"packages/credentials/authorization/src/index.ts","lineNumber":205,"sourceCode":"  private readonly running = new Map<CredentialKey, InFlight>()\n\n  constructor(ctx: Context) {\n    super(ctx, 'authorization')\n  }\n\n  /**\n   * Offer a way to obtain one credential. One flow per key: two plugins\n   * claiming the same key would each write a record in their own format, and\n   * whichever ran last would leave the other reading a payload it cannot parse.\n   *\n   * @param flow - the key it writes, its label, its methods, and its runner.\n   * @returns Disposer that withdraws this flow.\n   * @throws {AuthorizationError} code `DUPLICATE_FLOW` when the key is already claimed.\n   */\n  registerFlow(flow: AuthorizationFlow): () => void {\n    const dispose = this.ctx.effect(function* (this: AuthorizationService) {\n      if (this.flows.has(flow.key)) {\n        throw new AuthorizationError(\n          `an authorization flow for \"${flow.key}\" is already registered`, 'DUPLICATE_FLOW')\n      }\n      this.flows.set(flow.key, flow)\n      yield () => {\n        this.flows.delete(flow.key)\n        // A flow leaving mid-attempt takes its attempt with it: the runner\n        // belongs to a plugin that is going away, so letting it keep prompting\n        // would outlive the fiber that can answer for it.\n        this.running.get(flow.key)?.controller.abort()\n      }\n    }.bind(this), 'authorization.registerFlow()')\n    return () => void dispose()\n  }\n\n  /**\n   * Every registered flow, for a surface listing what can be authorized.\n   * @returns one entry per flow, in registration order.\n   */","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/credentials/authorization/src/index.ts#L187-L223","documentation":"Error \"an authorization flow for \"${flow.key}\" is already registered\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/credentials/authorization/src/index.ts:205 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"}