stablyai/orca · error

This file has not been shared from the active Orca profile.

Error message

This file has not been shared from the active Orca profile.

What it means

Thrown inside ArtifactCloudService.update() when getArtifactShareRecord() returns no record for the given (profileId, sourceKey, scope). The update path expects an existing share (slug + editToken) to PUT against; with no record there is nothing to update. It fires after assertArtifactSharingAllowed and inside publisher.runForSource, so auth is already resolved.

Source

Thrown at src/main/artifacts/artifact-cloud-service.ts:208

    const idempotencyKey = randomUUID()
    return this.withAuth(request, (token, apiUrl, auth) =>
      this.publisher.publish(request, token, apiUrl, auth, idempotencyKey)
    )
  }

  async update(request: ArtifactWriteRequest): Promise<ArtifactCloudOperation<ArtifactListItem>> {
    assertArtifactSharingAllowed(this.isSharingEnabled)
    return this.withAuth(request, (token, apiUrl, auth) =>
      this.publisher.runForSource(request.sourceKey, auth, async () => {
        auth.assertCurrent()
        const record = getArtifactShareRecord(
          auth.profileId,
          this.userDataPath,
          request.sourceKey,
          auth.scope
        )
        if (!record) {
          throw new Error('This file has not been shared from the active Orca profile.')
        }
        return this.publisher.runForSlug(record.slug, auth, async () => {
          auth.assertCurrent()
          const response = await artifactRequest<ArtifactListItem>(
            apiUrl,
            token,
            `/${record.slug}`,
            {
              method: 'PUT',
              editToken: record.editToken,
              body: artifactWriteBody(request)
            }
          )
          auth.assertCurrent()
          refreshArtifactShareRecordExpiration(
            auth.profileId,
            this.userDataPath,
            request.sourceKey,

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Create/share the artifact first (createShare) to populate a share record, then call update.
  2. Confirm the request.sourceKey and request.scope exactly match the values used when the artifact was originally shared.
  3. Inspect the share-record store file for the active profileId and verify the record exists; if it was pruned/expired, re-share instead of updating.

Example fix

// before
await service.update({ sourceKey, scope: 'org', ... }) // no record under 'org'

// after
const record = getArtifactShareRecord(profileId, userDataPath, sourceKey, 'org')
if (!record) {
  await service.createShare({ sourceKey, scope: 'org', ... })
  return
}
await service.update({ sourceKey, scope: 'org', ... })
Defensive patterns

Strategy: validation

Validate before calling

import { getArtifactShareRecord } from '...'

const record = getArtifactShareRecord(profileId, userDataPath, sourceKey, scope)
if (!record) {
  // nothing to update — create/share first
  await service.createShare({ sourceKey, scope, ... })
  return
}
await service.update({ sourceKey, scope, ... })

Type guard

import type { ArtifactShareRecord } from '...'

function isShareRecord(v: unknown): v is ArtifactShareRecord {
  return typeof v === 'object' && v !== null
    && typeof (v as ArtifactShareRecord).slug === 'string'
    && typeof (v as ArtifactShareRecord).editToken === 'string'
}

Try / catch

try {
  await service.update(request)
} catch (e) {
  if (e instanceof Error && e.message === 'This file has not been shared from the active Orca profile.') {
    await service.createShare(request) // fall back to create
    return
  }
  throw e
}

Prevention

When it happens

Trigger: Calling update on an artifact that was never shared, whose share record expired and was pruned, whose scope (user vs org) differs from the one used at share time, or whose record lives under a different profileId.

Common situations: User edits a file and hits 'update share' before the original create completed/recovered; the share-record JSON was deleted from userData; the share record was pruned because it expired; the caller passed the wrong ArtifactShareScope.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/43258c5940f135e7. Report an issue: GitHub.