TencentCloud/TencentDB-Agent-Memory · error

skill get failed: ${getEnv.code}

Error message

skill get failed: ${getEnv.code}

What it means

forkSkillToAgent fetches the source skill's full detail (content + manifest) via an internal skill 'get' command executed in a forked environment. The command returns an envelope with a code; any non-zero code means the fetch failed, and the function throws with that code so the fork (cloneTemplateAssets) aborts before creating the copy.

Source

Thrown at MemoryPanel/src/panel/http/routes/meta/proxy.ts:356

}

/** fork skill 到目标 agent(get → files/read → create),复用前端 forkToAgent 的语义。 */
async function forkSkillToAgent(
  deps: PanelDeps,
  ctx: MetaCallContext,
  userId: string,
  teamId: string,
  sourceSkillId: string,
  targetAgentId: string,
): Promise<void> {
  const getEnv = await deps.skillKernel.invoke('get', {
    user_id: userId,
    team_id: teamId,
    skill_id: sourceSkillId,
    include_content: true,
    include_manifest: true,
  }, ctx);
  if (getEnv.code !== 0) throw new Error(`skill get failed: ${getEnv.code}`);
  const detail = getEnv.data as {
    name: string;
    content: string;
    manifest?: Array<{ path: string; is_executable?: boolean }>;
  };

  const resources: Array<{
    path: string;
    content: string;
    encoding: string;
    mime_type?: string;
    is_executable?: boolean;
  }> = [];
  for (const entry of detail.manifest ?? []) {
    try {
      const fEnv = await deps.skillKernel.invoke('files/read', {
        user_id: userId,
        team_id: teamId,

View on GitHub (pinned to 3efcd317b8)

Solutions

  1. Log/inspect getEnv.code and the underlying env stderr to identify the actual failure (404 vs permission)
  2. Verify sourceSkillId exists and is accessible to user_id/team_id before forking
  3. Refresh the source skill id from the skill list API
  4. Retry on transient backend failures; abort the fork for permanent codes

Example fix

// before
if (getEnv.code !== 0) throw new Error(`skill get failed: ${getEnv.code}`);
// after
if (getEnv.code !== 0) {
  logger.error(`skill get failed: code=${getEnv.code} stderr=${getEnv.stderr}`);
  throw new Error(`skill get failed: ${getEnv.code} (${getEnv.stderr ?? 'no detail'})`);
}
Defensive patterns

Strategy: try-catch

Validate before calling

const exists = await skillsApi.exists({ skill_id: sourceSkillId, team_id: teamId });
if (!exists) throw new Error(`source skill ${sourceSkillId} not accessible`);

Try / catch

try { await forkSkillToAgent(...); } catch (e) { if (e.message.startsWith('skill get failed:')) { logger.error(`cannot read source skill (${e.message}); check skill_id and permissions`); } else throw e; }

Prevention

When it happens

Trigger: Forking a skill whose skill_id does not exist, belongs to another user/team without access, or whose backend 'get' call fails (include_content/include_manifest request rejected).

Common situations: Forking from a template skill that was deleted; cross-team skill fork without permission; transient backend error surfacing as a non-zero exit code; stale sourceSkillId after skill deletion.

Related errors


AI-assisted analysis of TencentCloud/TencentDB-Agent-Memory@3efcd317b8 (2026-09-01). Data as JSON: /api/errors/1a5f297fe62d18a4. Report an issue: GitHub.