You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8937f50
Browse filesBrowse the repository at this point in the historyBrowse files
feat(web): the scratch workspace answers search, and the end-to-end check covers the agent's file tools
Quick Open, the Search view and workspace.findFiles (the agent's list_files) wait forever for a
provider registered for the folder's scheme. The scratch workspace now registers a file and a
text search provider (proposed APIs, declared by this built-in extension).
e2e: list, search, read and edit through the real tool loop, Quick Open, and a wait for the run
to finish between prompts (the send button is the stop button while a run is active).
constturns=awaitask('Please create a hello file');
153
+
check('the agent called the model through the gateway and got the tool result back',turns>=2,'turns: '+turns);
154
+
check('write_file created hello.txt in the scratch workspace',(awaitscratchFile('/hello.txt'))==='hello from the browser\n',JSON.stringify(awaitscratchFile('/hello.txt')));
check('the agent was not offered a shell',tools.length>0&&!tools.includes('run_command')&&tools.includes('write_file'),tools.join(','));
139
-
awaitsleep(1500);
156
+
check('the agent was not offered a shell',tools.length>0&&!tools.includes('run_command')&&!tools.includes('read_command_output')&&tools.includes('write_file'),tools.join(','));
check('list_files sees the scratch workspace (findFiles is answered by the scratch search provider)',/README\.md/.test(listed)&&/hello\.txt/.test(listed),JSON.stringify(listed.slice(0,120)));
163
+
awaitask('Please search the project');
164
+
constfound=lastToolResult();
165
+
check('search finds text without ripgrep',/hello\.txt:1:hellofromthebrowser/.test(found),JSON.stringify(found.slice(0,160)));
166
+
awaitask('Please read the greeting');
167
+
check('read_file returns the file',/hellofromthebrowser/.test(lastToolResult()),JSON.stringify(lastToolResult().slice(0,80)));
168
+
awaitask('Please change the greeting');
169
+
check('edit_file edits it in place',(awaitscratchFile('/hello.txt'))==='hello again\n',JSON.stringify(awaitscratchFile('/hello.txt')));
if(/\bcreate\b/i.test(text)){returncall('write_file',{path: 'hello.txt',content: 'hello from the browser\n',explanation: 'Create the greeting file'},'I will create the file now.');}
53
+
if(/\blist\b/i.test(text)){returncall('list_files',{},'Let me look at the files.');}
54
+
if(/\bsearch\b/i.test(text)){returncall('search',{query: 'hello',explanation: 'Find the greeting'},'Searching.');}
55
+
if(/\bread\b/i.test(text)){returncall('read_file',{path: 'hello.txt',explanation: 'Read the greeting file'},'Reading it.');}
56
+
if(/\bchange\b/i.test(text)){returncall('edit_file',{path: 'hello.txt',old_str: 'hello from the browser',new_str: 'hello again',explanation: 'Change the greeting'},'Changing it.');}
57
57
return{text: 'Hello from the stand-in gateway.'};
58
58
}
59
59
@@ -67,7 +67,7 @@ export async function startStub(o) {
0 commit comments