Skip to content

Commit da1fb0e

Browse files
committed
chore: add module 9
1 parent 14512e9 commit da1fb0e

1 file changed

Lines changed: 180 additions & 5 deletions

File tree

apps/web/src/data/sheet/module-9.ts

Lines changed: 180 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,186 @@ import { SheetModule } from "./types";
22

33
export const module9: SheetModule = {
44
id: "module-9",
5-
name: "Live fix/implement the issue - 1",
5+
name: "Continuing contribution from module 8 - understanding issue closure",
66
docContent: `
7-
<h1>Live fix/implement the issue - 1</h1>
8-
<p>First live session on fixing and implementing an issue in an OPEN SOURCE project.</p>
7+
<h1>module 9: extending the browser-use contribution</h1>
8+
9+
<p><strong>note:</strong> as this module is implementation focused, try watching the <a href="https://youtu.be/hRMtIB-pkeE" target="_blank" rel="noopener noreferrer" style="color: #9455f4; text-decoration: underline;">video</a> so that you can have better understanding.</p>
10+
11+
<p>in this module we're continuing the contribution we started in module 8. in module 8 we began working on an issue in the browser-use repo, and here we'll extend that work.</p>
12+
13+
<p><strong>note:</strong> if you haven't watched module 7 and module 8, you should do that first — otherwise nothing in this module will make sense.</p>
14+
15+
<h3 style="margin-top: 40px; margin-bottom: 20px; color: #9455f4;">checking the issue status</h3>
16+
17+
<p>so let's open the issue we were working on. it's already closed.</p>
18+
19+
<p>four days ago, in module 8, we commented that we weren't able to reproduce the exact error described in the issue.</p>
20+
21+
<p>now, someone else replied saying that when the error triggers, the whole system crashes and floods the terminal with a huge amount of errors, which makes it impossible to see the real root cause.</p>
22+
23+
<p>he didn't attach screenshots, so we still didn't have full clarity.</p>
24+
25+
<p>after that, the original issue creator replied and tagged me. he shared screenshots and explained the real behavior.</p>
26+
27+
<h3 style="margin-top: 40px; margin-bottom: 20px; color: #9455f4;">understanding what the issue creator meant</h3>
28+
29+
<p>the contributor said:</p>
30+
31+
<p><em>when the deepseek model returns a response without the action field, the error is added to the agent history, but the LLM doesn't react to that error.</em></p>
32+
33+
<p>so even if the agent says "hey deepseek, action field is missing", deepseek still keeps responding without the action field.</p>
34+
35+
<p><strong>this creates a repeating loop of failures.</strong></p>
36+
37+
<p>the contributor also fixed a local FILE-URL security issue for himself, but clarified that the core bug has nothing to do with files — it's purely about deepseek not returning the required field.</p>
38+
39+
<p>he then shared screenshots showing:</p>
40+
41+
<ul style="list-style: disc; padding-left: 24px; margin-top: 12px;">
42+
<li style="margin-bottom: 8px;">the schema has required fields: thinking, evaluation, previous_goal, memory, next_goal, action</li>
43+
<li style="margin-bottom: 8px;">deepseek returns everything except action</li>
44+
<li style="margin-bottom: 8px;">pydantic throws a validation error</li>
45+
<li style="margin-bottom: 8px;">agent retries, sends that error back</li>
46+
<li style="margin-bottom: 8px;">deepseek still doesn't fix itself</li>
47+
<li style="margin-bottom: 8px;">that means the failure multiplies</li>
48+
</ul>
49+
50+
<p>this exactly matches what another commenter said earlier: <strong>multiple errors spam the terminal.</strong></p>
51+
52+
<p>so now we finally understand the real root cause.</p>
53+
54+
<h3 style="margin-top: 40px; margin-bottom: 20px; color: #9455f4;">reproducing the issue properly</h3>
55+
56+
<p>since the real bug isn't tied to FILE-URL access or html parsing, we don't need to recreate the whole file scenario from module 8.</p>
57+
58+
<p>the bug appears in any task as long as deepseek returns a response missing "action".</p>
59+
60+
<p>we just need to run a task with deepseek, catch the output, and check agent history.</p>
61+
62+
<p>the maintainer also pointed out where the missing check might live:</p>
63+
64+
<p style="margin-left: 24px;"><code>browser_use.agent.service.Agent.get_model_output_with_retry()</code></p>
65+
66+
<h3 style="margin-top: 40px; margin-bottom: 20px; color: #9455f4;">why the issue was closed without a PR</h3>
67+
68+
<p>now the important part: <strong>why did the maintainer close the issue with no PR?</strong></p>
69+
70+
<p>here's the maintainer's final comment:</p>
71+
72+
<p style="margin-left: 24px;"><em>some models are unfortunately bad at obeying the structured output schema.</em></p>
73+
74+
<p style="margin-left: 24px;"><em>we recommend using system_prompt_extension to explicitly describe the output format to the model.</em></p>
75+
76+
<p><strong>in short:</strong></p>
77+
78+
<ul style="list-style: disc; padding-left: 24px; margin-top: 12px;">
79+
<li style="margin-bottom: 8px;">deepseek simply doesn't follow the schema</li>
80+
<li style="margin-bottom: 8px;">so this isn't a browser-use bug, it's a model behavior problem</li>
81+
</ul>
82+
83+
<p>the library already provides a built-in solution:</p>
84+
85+
<p style="margin-left: 24px;"><strong>extend_system_message</strong> — a system-prompt extension that lets you explicitly tell the model how to format its output.</p>
86+
87+
<p>so rather than patch browser-use for a model-specific issue, the correct fix is:</p>
88+
89+
<p style="margin-left: 24px;">use the system prompt extension to force deepseek to follow the required schema.</p>
90+
91+
<p><strong>that's why the maintainers didn't want a PR for this.</strong></p>
92+
93+
<h3 style="margin-top: 40px; margin-bottom: 20px; color: #9455f4;">lessons from the PR attempt by someone else</h3>
94+
95+
<p>another contributor opened a PR to "fix" this issue. the PR wasn't merged, and here are the mistakes worth learning from:</p>
96+
97+
<ul style="list-style: none; padding-left: 0; margin-top: 12px;">
98+
<li style="margin-bottom: 12px; padding-left: 24px; position: relative;">
99+
<span style="position: absolute; left: 0;">❌</span>
100+
<strong>didn't get maintainer approval first</strong> — always ask maintainers before fixing unclear issues
101+
</li>
102+
<li style="margin-bottom: 12px; padding-left: 24px; position: relative;">
103+
<span style="position: absolute; left: 0;">❌</span>
104+
<strong>didn't fully understand the root cause</strong> — he attempted to fix a model-side issue at the agent level
105+
</li>
106+
<li style="margin-bottom: 12px; padding-left: 24px; position: relative;">
107+
<span style="position: absolute; left: 0;">❌</span>
108+
<strong>didn't use proper PR formatting</strong> — he didn't use "fixes #&lt;issue-number&gt;" or "addresses #&lt;issue-number&gt;", so Github couldn't auto-close anything
109+
</li>
110+
<li style="margin-bottom: 12px; padding-left: 24px; position: relative;">
111+
<span style="position: absolute; left: 0;">❌</span>
112+
<strong>no tests, no screenshots</strong> — always attach before/after results or output logs
113+
</li>
114+
<li style="margin-bottom: 12px; padding-left: 24px; position: relative;">
115+
<span style="position: absolute; left: 0;">❌</span>
116+
<strong>poor commit messages</strong> — commit messages should follow good conventions like "fix: missing action field validation" instead of random unclear messages
117+
</li>
118+
<li style="margin-bottom: 12px; padding-left: 24px; position: relative;">
119+
<span style="position: absolute; left: 0;">❌</span>
120+
<strong>didn't sign the CLA</strong> — most OPEN SOURCE projects require this before merging
121+
</li>
122+
</ul>
123+
124+
<p><strong>learning these early will save months of frustration.</strong></p>
125+
126+
<h3 style="margin-top: 40px; margin-bottom: 20px; color: #9455f4;">what "system prompt extension" actually means</h3>
127+
128+
<p><code>extend_system_message</code> lets you ADD extra instructions to the LLM without replacing the default system prompt.</p>
129+
130+
<p><strong>example:</strong></p>
131+
132+
<p style="margin-left: 24px;">tell the model explicitly — "always include an action field in your response."</p>
133+
134+
<p>this is like the "additional note" option in food-delivery apps: the system already knows your order, but you add a custom instruction like "please bring cutlery" or "don't ring the bell".</p>
135+
136+
<p>same vibe here.</p>
137+
138+
<p>so instead of hacking the agent code, you use the built-in system message extension to guide the model.</p>
139+
140+
<p><strong>problem solved.</strong></p>
141+
142+
<h3 style="margin-top: 40px; margin-bottom: 20px; color: #9455f4;">the wrap-up</h3>
143+
144+
<p>even though the issue got closed before we could raise a PR, we still learned a lot:</p>
145+
146+
<ul style="list-style: none; padding-left: 0; margin-top: 12px;">
147+
<li style="margin-bottom: 8px; padding-left: 24px; position: relative;">
148+
<span style="position: absolute; left: 0;">✓</span>
149+
how to reproduce bugs
150+
</li>
151+
<li style="margin-bottom: 8px; padding-left: 24px; position: relative;">
152+
<span style="position: absolute; left: 0;">✓</span>
153+
how to interpret contributor comments
154+
</li>
155+
<li style="margin-bottom: 8px; padding-left: 24px; position: relative;">
156+
<span style="position: absolute; left: 0;">✓</span>
157+
how agent history works
158+
</li>
159+
<li style="margin-bottom: 8px; padding-left: 24px; position: relative;">
160+
<span style="position: absolute; left: 0;">✓</span>
161+
how retry loops create cascading failures
162+
</li>
163+
<li style="margin-bottom: 8px; padding-left: 24px; position: relative;">
164+
<span style="position: absolute; left: 0;">✓</span>
165+
how to ask clarifying questions
166+
</li>
167+
<li style="margin-bottom: 8px; padding-left: 24px; position: relative;">
168+
<span style="position: absolute; left: 0;">✓</span>
169+
how maintainers think about issues
170+
</li>
171+
<li style="margin-bottom: 8px; padding-left: 24px; position: relative;">
172+
<span style="position: absolute; left: 0;">✓</span>
173+
how to avoid bad PR habits
174+
</li>
175+
<li style="margin-bottom: 8px; padding-left: 24px; position: relative;">
176+
<span style="position: absolute; left: 0;">✓</span>
177+
how the model vs agent boundary works
178+
</li>
179+
</ul>
180+
181+
<p style="margin-top: 24px;">in the next module, we'll pick another issue — ideally one we can actually fix and raise a PR for.</p>
182+
183+
<p>this is ajeetunc. see you in the next module.</p>
9184
`,
10-
videoUrl: "",
11-
comingSoon: true,
185+
videoUrl: "https://youtu.be/hRMtIB-pkeE",
186+
comingSoon: false,
12187
};

0 commit comments

Comments
 (0)