Code Execution Fallback E81068 logo

Code Execution Fallback E81068

OrganizationPopular
HKUDS
code-execution-fallback-e81068

Fallback workflow for executing Python code when execute_code_sandbox fails repeatedly

Overview

PublisherHKUDS
RepositoryOpenSpace
Skill namecode-execution-fallback-e81068
Stars
7.7K
Forks
918
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by HKUDS on GitHub. Read the source before you install it.

Installation

Install the Code Execution Fallback E81068 AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HKUDS/OpenSpace.git /tmp/OpenSpace
mkdir -p .claude/skills
cp -r /tmp/OpenSpace/benchmarks/gdpval/skills/code-execution-fallback-e81068 .claude/skills/code-execution-fallback-e81068
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Code Execution Fallback E81068 in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Code Execution Fallback E81068 on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Code Execution Fallback E81068 is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Code Execution Fallback Workflow

When to Use

Use this skill when execute_code_sandbox fails repeatedly (2+ attempts) with unknown, persistent, or unexplained errors. This fallback approach uses write_file + run_shell to save Python scripts to disk and execute them via command line, which has proven more reliable in certain failure scenarios.

Step-by-Step Instructions

Step 1: Detect Repeated Failures

Monitor execute_code_sandbox attempts. After 2 consecutive failures with errors like:

  • "Unknown error"
  • Timeout errors
  • Unexplained execution failures
  • Sandbox environment issues

Switch to the fallback workflow immediately.

Step 2: Write the Python Script to File

Use write_file to save your Python code as a .py file in the working directory:

python
write_file(
    path="script.py",
    content="""
import sys
import json

# Your Python code here
def main():
    # Your logic
    result = {"status": "success", "data": "example"}
    print(json.dumps(result))

if __name__ == "__main__":
    main()
"""
)

Tips:

  • Use clear, self-contained code that doesn't rely on sandbox-specific paths
  • Include error handling and informative print statements
  • Save output to files if needed for later retrieval

Step 3: Execute via Shell

Use run_shell to execute the Python script via command line:

python
run_shell(
    command="python3 script.py",
    timeout=60  # Adjust timeout as needed
)

Alternative commands:

  • python script.py - if python3 alias isn't available
  • python3 -u script.py - for unbuffered output
  • python3 script.py arg1 arg2 - with arguments

Step 4: Verify Output and Results

Check the stdout/stderr from run_shell to:

  • Confirm execution succeeded (exit code 0)
  • Inspect printed output or results
  • Identify any new errors (different from sandbox errors)

If the script writes output files, use read_file to retrieve results.

Step 5: Clean Up (Optional)

Remove temporary script files if they won't be reused:

python
run_shell(command="rm script.py")

Complete Example

Scenario: execute_code_sandbox failed twice while trying to process data.

Fallback execution:

python
# Step 1: Write the processing script
write_file(
    path="process_data.py",
    content="""
import pandas as pd
import json

def process():
    data = [1, 2, 3, 4, 5]
    result = {"sum": sum(data), "count": len(data)}
    print(json.dumps(result))
    
    # Also save to file for reliability
    with open("result.json", "w") as f:
        json.dump(result, f)

if __name__ == "__main__":
    process()
"""
)

# Step 2: Execute via shell
output = run_shell(command="python3 process_data.py")

# Step 3: Read results from file
results = read_file(file_path="result.json", filetype="json")

Troubleshooting

IssueSolution
python3: command not foundTry python instead, or check available interpreters with which python
Permission deniedEnsure the working directory is writable; write_file creates files in workspace by default
Module not foundInstall dependencies via run_shell(command="pip install package_name") before execution
Script hangsIncrease timeout parameter in run_shell
Output too longRedirect output to file within the script and read it separately

Best Practices

  1. Always include error handling in scripts to capture failures gracefully
  2. Write results to files in addition to printing, for reliable retrieval
  3. Use descriptive filenames to avoid conflicts (e.g., task_specific_script.py)
  4. Keep scripts self-contained - avoid dependencies on sandbox environment variables
  5. Log execution details for debugging: print(f"Step X complete: {value}")

When NOT to Use This Fallback

  • When sandbox isolation is required for security
  • When the task explicitly requires execute_code_sandbox
  • When execute_code_sandbox succeeds consistently (no need to add complexity)
  • When working with sensitive data that shouldn't persist to disk

Frequently asked questions

What does the Code Execution Fallback E81068 AI skill do?

Fallback workflow for executing Python code when execute_code_sandbox fails repeatedly

Why use Code Execution Fallback E81068 on TypingMind?

Because you install it once and use it with any model. Code Execution Fallback E81068 is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Code Execution Fallback E81068 in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/HKUDS/OpenSpace/tree/main/benchmarks/gdpval/skills/code-execution-fallback-e81068. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Code Execution Fallback E81068?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Code Execution Fallback E81068?

As many as you like. As long as a model supports skills, you can use Code Execution Fallback E81068 with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Code Execution Fallback E81068 AI skill free?

Yes. It is published on GitHub by HKUDS under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇