LangChain’s persistent goal loop acknowledges that autonomy without continuous verification is just a faster way to fail. This approach moves agentic workflows from "hope-based" execution to a disciplined, criteria-driven engineering process.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
/goal: Building big features with dcode
Added:What you're looking at right now is dcode, my open source model agnostic coding agent implementing a feature in one shot.
As you can tell from the length, this is a feature that takes a lot of code, a lot of review and a lot of time.
In order to one shot this, I used a new feature in dcode, the /goal command.
So what is /goal and why is it needed?
It is needed whenever you want to accomplish an especially large task like a meaty or an experimental PR. It gives an agent a long running, persistent objective to work toward over a long period of time. And to illustrate this, imagine a react loop. A request comes in and the agent reasons about it, acts on it, observes the results and responds. The goal loop doesn't replace the agent loop, but rather wraps it. The inner loop decides the next action, the outer loop asks whether those actions actually achieved the durable goal. If the criteria aren't met, the goal remains active. If progress is impossible, it becomes blocked. Only evidence satisfying the criteria completes it. We're going to be working with dcode, the model agnostic open source coding agent built for control over your development workflows. And we'll be dealing with source code so you can do cool things like adding native browser control. You can download dcode using the link below.
For now, let's jump in. After installing dcode using the install script found in the docs page, fire it up with dcode. Now I'll type /goal add native browser control compatibility to dcode without using MCP.
With some typos, by the way.
Press Enter and the first thing that dcode does is turn that into a short set of acceptance criteria.
Now acceptance criteria are the durable requirements which guide the agent's work.
So we have here, dcode can launch and control a browser through its native browser control interface.
And these criteria mostly look right, but say I want to add a piece of criteria.
I'll choose edit criteria.
Let's add a bullet point here and say, this is done using the Python Playwright API.
Press enter and it will be accepted and the goal is now active with typos.
So the visible criteria step is super important and it's not available in some other agents like Codex.
You've probably experienced this, but for substantial tasks, one-shotting usually just doesn't get you all the way there.
The agent will create a solution that doesn't quite match what you had in mind or finish the main feature without tests or CI will fail.
And the net result here is that the bottleneck becomes keeping yourself in the loop throughout the entire process.
You can imagine concretely, you submit the model request, the agent builds what you sort of want, and then you spend a substantial amount of time fixing and correcting things.
But /goal shifts that extra alignment upfront, makes it visible and allows you to tailor those requirements mid run, which we'll see later.
Looking back at the screen now, dcode is working on the task, doing things like inspecting the current architecture, identifying where browser support belongs, implementing it, it notes here, Python Playwright.
The goal remains active throughout this thread.
And we can see that in the input box.
Or if I were to interrupt the agent, we can type in /goal show for more detailed information, including the original criteria.
So let's say that I wanna add some guidance here.
I can type in /goal amend.
and I will say, ensure that CI passes at the end.
I don't need to repeat the browser control task or paste the original requirements again.
The message is interpreted in the context of the active goal.
And I think this is a huge value add.
It allows us to direct ourselves toward a better product without needing to involve a ton of human-in-the-loop interactions following what would otherwise be an incorrect completion of work. This will now update our current goal criteria and then I can use /goal resume in order to continue making the machine work. Okay, so the agent is buzzing along, but I just want to jump in real quick because I want to show you something that I think is really cool. We're going to take a peek under the hood. So we'll interrupt the agents and we will type in /trace. Assuming that you've enabled LangSmith tracing for dcode, you can type /trace to open the trace for the current dcode session in the LangSmith web portal.
And now here we can see what's happening turn by turn in our conversation.
So let's click into this larger turn here and we'll see our inputs.
And this is the goal prompt that we had submitted to the model.
Here we can see a breakdown of all the work associated with this goal prompt.
This is a super useful tool in debugging your workflows among a ton of other things.
We have other videos on LangSmith that I recommend checking out.
We don't have enough time in this video.
Now let's get back to the agent run and hopefully it's done.
Okay, stepping back to the computer.
You can probably tell that time has passed because of the change in lighting in here and we are at goal completed.
Let's scroll up.
Yeah, plenty of file edits.
Looks like some tests.
Implemented native Python Playwright browser controls, enabled with this browser flag.
Works alongside no MCP.
Okay, cool.
Chrome smoke tests, code quality systems passing, full test suite passes.
Okay, well, none of this really matters if it doesn't work.
So let's try it out.
So we will run dcode with this browser flag.
I think it said I have to do this /browser.
Yeah, that looks like it enabled browser tools.
All right.
Browser tools enabled for this thread.
And we'll say visit langchain.com.
Approve.
And there it is.
we have a browser running with langchain.com.
That is really cool.
Like really cool.
I mean, this is sort of a huge feature that we added to our local version of dcode all with one /goal command.
And I mean, this really illustrates the power of both /goal and open source, right?
We are modifying the agent, the harness itself in order to bring this into reality.
That is really cool.
We were able to modify our own agent because dcode is open source, meaning that you can do this right now.
I started this goal at 3pm and I came back around 7 and during that time I didn't have to continuously restate the task or maintain a mental checklist of everything dcode was supposed to do.
Aligning early on criteria and keeping it visible kept everything in check for the length of the run.
Again, we're including the link below so that you can build out your own harness modifications or do other huge units of work using /goal.
Thanks for watching and I'll see you in the next one.
[MUSIC PLAYING]
Related Videos

TOP 15 Data compression Interview Questions and Answers 2019 Part-2 | Data compression | Wisdom jobs
wisdomjobs
281 views•2019-06-28

CTS 158: 802.11w Management Frame Protection
ClearToSend
4K views•2019-02-04

NDSS 2019 Send Hardest Problems My Way: Probabilistic Path Prioritization for Hybrid Fuzzing
NDSSSymposium
496 views•2019-04-02

How realistic is Cities: Skylines?
CityBeautiful
159K views•2019-02-14

GUIs & TUIs: Choosing a User Interface for Your Python Project | Real Python Podcast
realpython
2K views•2025-04-04

The OSI Model - Explained by Example
hnasr
225K views•2019-05-12

Cloud Computing - Introduction
elithecomputerguy
98K views•2019-10-07

From Traveler's Dilemma to Dynamic Routing | Demystifying Networking
IITBombayJuly
5K views•2019-08-04
Trending

WOW! Judge TURNS THE TABLES on Trump in His OWN $10B LAWSUIT!!!
MeidasTouch
197K views•2026-07-23

Playstation NO DISC/NO BUY Fight Is Over...
DavidJaffeGames
4K views•2026-07-23

Steam and Xbox Just Dropped The Hammer On PlayStation
OhNoItsAlexx
9K views•2026-07-23

Americans Confused in Australia for 17 Minutes Straight
IWrocker
17K views•2026-07-23