{"record":{"id":"b33f5f5ab3dcab07","repo":"deepseek-ai/deepseek-harness","slug":"lookup-not-found","errorCode":"lookup-not-found","errorMessage":"lookup provider ${JSON.stringify(key)} did not resolve the requested identity","messagePattern":"lookup provider (.+?) did not resolve the requested identity","errorType":"exception","errorClass":"TypertGatewayError","httpStatus":null,"severity":"error","filePath":"packages/api/gateway/src/index.ts","lineNumber":460,"sourceCode":"        endpoint,\n        `lookup provider ${JSON.stringify(key)} does not match its strict definition`,\n        { field: parameter.wire },\n      )\n    }\n    let resolved: unknown\n    try {\n      resolved = await provider.resolve(value)\n    } catch (cause) {\n      if (cause instanceof TypertLookupFailure) throw cause\n      throw new TypertGatewayError(\n        'lookup-failed',\n        endpoint,\n        `lookup provider ${JSON.stringify(key)} failed`,\n        { cause, field: parameter.wire },\n      )\n    }\n    if (resolved === undefined) {\n      throw new TypertGatewayError(\n        'lookup-not-found',\n        endpoint,\n        `lookup provider ${JSON.stringify(key)} did not resolve the requested identity`,\n        { field: parameter.wire },\n      )\n    }\n    return resolved\n  }\n}\n\nfunction rpcFailure(error: unknown): ConnectionRpcResult {\n  if (error instanceof RemoteInvocationCancelled) {\n    return {\n      ok: false,\n      error: { code: 'cancelled', message: error.message, details: {} },\n    }\n  }\n  if (error instanceof TypertLookupFailure) {","sourceCodeStart":442,"sourceCodeEnd":478,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/api/gateway/src/index.ts#L442-L478","documentation":"The lookup provider resolved without throwing but returned undefined: the wire id in the parameter's field does not correspond to any live Host object. This is the 404-equivalent for lookup parameters — the endpoint, provider, and request shape are all fine, but that id has no target to bind.","triggerScenarios":"Passing an id for a deleted, not-yet-created, or foreign-environment object in a lookup parameter — for example a docId whose document was removed after the client last listed it, or an id from a different deployment.","commonSituations":"Client holds stale ids after another user or process deleted the entity; race between create and first use; ids copied between dev and prod; hand-built request payloads with typo'd ids.","solutions":["Refresh the id from its source (re-list, re-open the owning resource) and retry with a current value.","If the entity should exist, verify it through the owning service directly, then check the provider's resolver coverage.","Map it to a clean 404 in the client; do not retry the same id unchanged."],"exampleFix":"// before — firing with an id cached long ago\nawait remote.docs.read({ docId })\n// → lookup-not-found after the document was deleted\n\n// after — validate against the current listing first\nconst docs = await remote.docs.list()\nif (!docs.some(doc => doc.id === docId)) throw new NotFound(`document ${docId}`)\nawait remote.docs.read({ docId })","handlingStrategy":"try-catch","validationCode":"import type { TypertLookupProvider } from '@deepseek-ai/dsh-typert-protocol'\n\n// Host-side callers can pre-check one id through the provider before the RPC.\nasync function idResolves(provider: TypertLookupProvider, id: unknown): Promise<boolean> {\n  return (await provider.resolve(id)) !== undefined\n}","typeGuard":"import { TypertGatewayError } from '@deepseek-ai/dsh-api-gateway'\n\nfunction isLookupNotFound(error: unknown): error is TypertGatewayError {\n  return error instanceof TypertGatewayError && error.code === 'lookup-not-found'\n}","tryCatchPattern":"try {\n  await gateway.invoke(request)\n} catch (error) {\n  if (error instanceof TypertGatewayError && error.code === 'lookup-not-found') {\n    // expected miss: surface a domain 404 keyed by error.field, never a 500\n    const id = (request.args as Record<string, unknown>)[error.field ?? '']\n    throw new NotFoundError(`${error.field} ${JSON.stringify(id)}`)\n  }\n  throw error\n}","preventionTips":["Treat ids as ephemeral: re-fetch listings before acting on user-held references.","Validate externally sourced ids against a list/exists endpoint before dispatching dependent calls.","Distinguish lookup-not-found (client-visible 404) from lookup-failed (server 5xx) in error mapping from day one."],"tags":["typert","gateway","lookup-provider","not-found","identity"],"backgroundTag":"entity-not-found","analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}