How to use the Code Debugger.
Debugging starts with expected behavior, actual behavior and a reproducible case. A likely cause should be tested rather than immediately declared the root cause.
Make the workflow fit your task.
Create the smallest case that shows expected and actual behavior, then form a testable explanation for the difference. Change one relevant cause at a time and rerun the failing case plus nearby boundaries.
- What you provide
- Code, error and reproduction details.
- What you get
- Likely causes and targeted fix suggestions.
See the input and the result.
Illustrative input and output · a teaching example, not a live WebAct run
Example input
Python reproduction:
items = ["A", "B"]
seen = []
for i in range(len(items) - 1):
seen.append(items[i])
Expected ["A", "B"]; actual ["A"].Completed example
Corrected loop:
seen = []
for item in items:
seen.append(item)
For ["A", "B"], seen becomes ["A", "B"]. Empty input produces []. Iterating over items directly removes the incorrect index boundary.Load this input into the prompt, then copy it to WebAct to try the task. Your result may differ from the illustration.
Decisions and troubleshooting.
Should the first plausible cause be treated as the root cause?
Treat it as a hypothesis until the reproduction supports it. Several different faults can produce the same symptom.
Why does the proposed fix work only for the example input?
Test the boundary around the failure and another ordinary input. A special-case patch may hide rather than resolve the underlying rule.
Try it with your own source.
Replace the example with your material in the task prompt. Keep the requirements you need, then copy the task into WebAct.
Customize and copy the task ↑