{"record":{"id":"8b1f4ae55c0ddf7d","repo":"can1357/oh-my-pi","slug":"output-not-found-join-not-found-n-navaila","errorCode":null,"errorMessage":"Output not found: {', '.join(not_found)}\\n\\nAvailable outputs: {', '.join(available[:20])} (and {len(available) - 20} more)","messagePattern":"Output not found: (.+?)\\\\n\\\\nAvailable outputs: (.+?) \\(and (.+?) more\\)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/eval/py/prelude.py","lineNumber":293,"sourceCode":"                }\n                if range_info:\n                    result_data[\"range\"] = range_info\n                if query:\n                    result_data[\"query\"] = query\n                results.append(result_data)\n            else:\n                results.append({\"id\": output_id, \"content\": selected_content})\n\n        # Handle not found\n        if not_found:\n            available = sorted([f.stem for f in Path(artifacts_dir).glob(\"*.md\")])\n            error_msg = f\"Output not found: {', '.join(not_found)}\"\n            if available:\n                error_msg += f\"\\n\\nAvailable outputs: {', '.join(available[:20])}\"\n                if len(available) > 20:\n                    error_msg += f\" (and {len(available) - 20} more)\"\n            _emit_status(\"output\", not_found=not_found, available_count=len(available))\n            raise FileNotFoundError(error_msg)\n\n        # Return format\n        if len(ids) == 1:\n            if format == \"json\":\n                _emit_status(\"output\", id=ids[0], chars=results[0][\"char_count\"])\n                return results[0]\n            _emit_status(\"output\", id=ids[0], chars=len(results[0][\"content\"]))\n            return results[0][\"content\"]\n\n        # Multiple IDs\n        if format == \"json\":\n            total_chars = sum(r[\"char_count\"] for r in results)\n            _emit_status(\"output\", count=len(results), total_chars=total_chars)\n            return results\n\n        combined_output: list[dict] = []\n        for r in results:\n            combined_output.append({\"id\": r[\"id\"], \"content\": r[\"content\"]})","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/eval/py/prelude.py#L275-L311","documentation":"After iterating the requested ids, `output()` raises this FileNotFoundError if any id had no corresponding `<id>.md` file in the artifacts directory. The message lists every missing id and up to 20 available output ids (plus a count of the rest) to help you correct the lookup.","triggerScenarios":"Calling `output([\"tool_9\"])` where `tool_9.md` doesn't exist; typo'd ids; querying a previous session's ids against a different run's artifacts directory.","commonSituations":"Referring to tool-call ids from memory instead of the session; artifacts directory cleared or regenerated between runs; ids from one eval session used while pointed at another session's artifacts.","solutions":["Use the 'Available outputs' list in the error message to pick the correct id.","Enumerate the artifacts directory (session `.jsonl` path minus extension) with `glob('*.md')` and match ids before calling.","Re-run the tool call that should have produced the artifact if it's genuinely missing."],"exampleFix":"// before\nids = [\"tool_9\", \"tool_10\"]\nresult = output(ids)\n\n// after\nimport pathlib\navailable = {p.stem for p in pathlib.Path(artifacts_dir).glob(\"*.md\")}\nids = [i for i in (\"tool_9\", \"tool_10\") if i in available]\nresult = output(ids) if ids else None","handlingStrategy":"validation","validationCode":"import pathlib\navailable = {p.stem for p in pathlib.Path(artifacts_dir).glob(\"*.md\")}\nmissing = [i for i in ids if i not in available]\nif missing:\n    print(f\"skipping missing: {missing}\")\n    ids = [i for i in ids if i in available]","typeGuard":null,"tryCatchPattern":"try:\n    result = output(ids)\nexcept FileNotFoundError as e:\n    msg = str(e)\n    available_section = msg.split(\"Available outputs:\")[-1].split(\"\\n\")[0]\n    print(f\"ids not found; available: {available_section}\")\n    result = None","preventionTips":["Copy ids from the session record, not from memory.","Enumerate `*.md` stems in the artifacts directory when unsure what exists.","Don't reuse ids across runs/sessions — artifacts are per-session."],"tags":["python","file-not-found","eval","artifacts"],"backgroundTag":"file-not-found","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}