DeepCode icon indicating copy to clipboard operation
DeepCode copied to clipboard

[Bug]: Code implementation failed: File tree structure not found, please run file tree creation first

Open jackhawa opened this issue 3 months ago • 6 comments

Do you need to file an issue?

  • [x] I have searched the existing issues and this bug is not already filed.
  • [ ] I believe this is a legitimate bug, not just a question or feature request.

Describe the bug

I have processed a arxiv paper in pdf format and all stages have passed except the Code implementation.

🔄 Workflow Stages Completed 📄 Document Processing: ✅ 🔍 Reference Analysis: ✅ 📋 Plan Generation: ✅ 📦 Repository Download: ✅ 🗂️ Codebase Indexing: ✅ ⚙️ Code Implementation: ⚠️

The error I got: Code implementation failed: File tree structure not found, please run file tree creation first

I have used openai gpt-5 model (medium reasoning effort) with brave search enabled. I have provided both open ai key and brave key. I have also installed all dependencies correctly.

Attached is the paper I have used to import.

MCTR.pdf

Can you assist me in understanding and fixing this issue?

Steps to reproduce

No response

Expected Behavior

No response

DeepCode Config Used

Paste your config here

Logs and screenshots

No response

Additional Information

  • DeepCode Version:
  • Operating System:
  • Python Version:
  • Related Issues:

jackhawa avatar Sep 04 '25 03:09 jackhawa

After some debugging, I have seen this message in the log (when setting level to debug)

{
  "data": {
    "id": "chatcmpl-CBvYO4cGGkkzdPPLphDrbN1jAc6W1",
    "choices": [
      {
        "finish_reason": "stop",
        "index": 0,
        "logprobs": null,
        "message": {
          "content": "I looked through the implementation plan you provided but I couldn't find any \"Code Organization\" or \"File Tree\" section or any explicit 
file tree to extract. I need the exact file tree listed in the plan to generate the required mkdir/touch commands and run them.\n\nPlease either:\n- Paste the \"Code 
Organization\" / \"File Tree\" section (the exact paths and files), or\n- Confirm that you want me to create a default skeleton (I can propose one such as a Python 
package with src/, tests/, README.md, etc.—I will show the exact tree first and then create it if you approve).\n\nWhich would you like?",
          "refusal": null,
          "role": "assistant",
          "annotations": [],
          "audio": null,
          "function_call": null,
          "tool_calls": null
        }
      }
    ],
    "created": 1756958880,
    "model": "gpt-5-mini-2025-08-07",
    "object": "chat.completion",
    "service_tier": "default",
    "system_fingerprint": null,
    "usage": {
      "completion_tokens": 394,
      "prompt_tokens": 781,
      "total_tokens": 1175,
      "completion_tokens_details": {
        "accepted_prediction_tokens": "0",
        "audio_tokens": "0",
        "reasoning_tokens": 256,
        "rejected_prediction_tokens": "0"
      },
      "prompt_tokens_details": {
        "audio_tokens": "0",
        "cached_tokens": "0"
      }
    },
    "_request_id": "req_a3409c72484947fea1944118cef2b6bd"
  }
}

Looks like the agent is trying to ask a question but I have never gotten a chance to respond to it. Is there a way to do that? Thanks.

jackhawa avatar Sep 04 '25 04:09 jackhawa

I have added an extra statement in the STRUCTURE_GENERATOR_PROMPT towards the end and it worked.

If you could not find any Code Organization or File Tree section or any explicit file tree to extract, create a default skeleton structure based on common practices for the project type mentioned in the plan.

jackhawa avatar Sep 04 '25 04:09 jackhawa

I get the same issue when using the Web interface. Running on cli it works fine.

matr1xp avatar Sep 04 '25 11:09 matr1xp

Same here, i'll try the cli

osiloke avatar Sep 04 '25 16:09 osiloke

Thanks @matr1xp 👍

jackhawa avatar Sep 06 '25 19:09 jackhawa

Same here will try cli.

eskrodelis avatar Sep 09 '25 07:09 eskrodelis

The problem has been solved, you can update the new version of DeepCode! Thank you!

Zongwei9888 avatar Nov 09 '25 16:11 Zongwei9888