Skip to content

Commit 9cca700

Browse files
Merge branch 'develop'
2 parents 413525e + c82d466 commit 9cca700

25 files changed

Lines changed: 520 additions & 26 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ This section of the CHANGELOG documents features that have been added to the ext
1010

1111
Auto-complete for blocks re-work: Partial implementation of auto-complete for blocks that works better than the default snippets that exists. This functions for if-then-else only right now to verify the user experience is what it needs to be.
1212

13+
## 6.0.2 - March 2026
14+
15+
Fixed an issue where, if IDL crashed or was stopped by the user, GitHub Copilot would not be notified and get in a bad state.
16+
1317
## 6.0.1 - March 2026
1418

1519
Add special instructions back in for ENVI like we have for IDL. These were disabled as a release in February broke the functionality, but it works again now.

apps/client-e2e/src/tests/mcp/_mcp-test-runner.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import { RunMCPTestSearchForFiles_RecursionAll } from './tools/general/search-fo
4343
import { RunMCPTestSearchForFiles_Single } from './tools/general/search-for-files/mcp-test-search-for-files-single';
4444
import { RunMCPTestCreateIDLNotebook } from './tools/idl/mcp-test-create-idl-notebook';
4545
import { RunMCPTestExecuteIDLCode } from './tools/idl/mcp-test-execute-idl-code';
46+
import { RunMCPTestExecuteIDLCode_CrashEmulation } from './tools/idl/mcp-test-execute-idl-code-crash-emulation';
4647
import { RunMCPTestExecuteIDLFile } from './tools/idl/mcp-test-execute-idl-file';
4748
import { RunMCPTestStartIDL } from './tools/idl/mcp-test-start-idl';
4849
import { RunMCPTestListGetPrompts } from './tools/mcp-test-list-get-prompt';
@@ -200,6 +201,12 @@ MCP_TEST_RUNNER.addTest({
200201
critical: true,
201202
});
202203

204+
MCP_TEST_RUNNER.addTest({
205+
fn: RunMCPTestExecuteIDLCode_CrashEmulation,
206+
name: 'Execute snippet of IDL code that shuts down IDL',
207+
critical: true,
208+
});
209+
203210
MCP_TEST_RUNNER.addTest({
204211
fn: RunMCPTestExecuteIDLFile,
205212
name: 'Execute file that contains IDL code',
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { MCP_TOOL_LOOKUP } from '@idl/types/mcp';
2+
import expect from 'expect';
3+
4+
import { RunnerFunction } from '../../../runner.interface';
5+
import { CallMCPTool } from '../../helpers/call-mcp-tool';
6+
7+
/**
8+
* Makes sure we can start IDL through MCP
9+
*/
10+
export const RunMCPTestExecuteIDLCode_CrashEmulation: RunnerFunction = async (
11+
init
12+
) => {
13+
/**
14+
* Run code that completes
15+
*/
16+
const result = await CallMCPTool(MCP_TOOL_LOOKUP.EXECUTE_IDL_CODE, {
17+
code: `print, 'foo'`,
18+
});
19+
20+
// make sure the tool runs
21+
expect(result.isError).toBeFalsy();
22+
23+
// verify we started
24+
expect(init.debug.adapter.isStarted()).toBeTruthy();
25+
26+
/**
27+
* Run code that causes IDL to crash/exit
28+
*/
29+
const runtimeError = await CallMCPTool(MCP_TOOL_LOOKUP.EXECUTE_IDL_CODE, {
30+
code: `help, 42\nexit`,
31+
});
32+
33+
expect(runtimeError.isError).toBeTruthy();
34+
35+
// verify we stopped
36+
expect(init.debug.adapter.isStarted()).toBeFalsy();
37+
38+
// verify that there was a reported
39+
expect(init.client.logger.tracker.errors).toBe(1);
40+
41+
// reset the tracker
42+
init.client.logger.resetTracker();
43+
};

apps/client-web/tsconfig.app.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@
182182
],
183183
"@idl/mcp/prompts": ["libs/mcp/prompts/src/index.ts"],
184184
"@idl/vscode/walkthroughs": ["libs/vscode/walkthroughs/src/index.ts"],
185+
"@idl/mcp/analytics-repository": [
186+
"libs/mcp/analytics-repository/src/index.ts"
187+
],
185188
"zod": ["node_modules/zod/v3"],
186189
"buffer": ["node_modules/buffer"],
187190
"os": ["node_modules/os-browserify"],

apps/sandbox/src/main.ts

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
1-
import { StringifyDataForLog } from '@idl/logger';
2-
import { IDLTypeHelper } from '@idl/parsing/type-parser';
3-
4-
const type = '0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15';
5-
// const type = 'ENVITask<FOOBERRy, Junior> | "5" | 6.0';
6-
7-
const parsed = IDLTypeHelper.parseIDLType(type);
8-
9-
console.log(StringifyDataForLog('', parsed));
10-
console.log(IDLTypeHelper.serializeIDLType(parsed));
1+
import { AnalyticsRepositoryRegistry } from '@idl/mcp/analytics-repository';
112

123
// const parsed2 = IDLTypeHelper.parseIDLType(serialize);
134

145
// console.log(StringifyDataForLog('', parsed));
156
// console.log(StringifyDataForLog('', serialize));
167
// console.log(StringifyDataForLog('', parsed2));
8+
9+
async function Main() {
10+
const registry = new AnalyticsRepositoryRegistry([
11+
{
12+
url: 'http://localhost:9194',
13+
},
14+
]);
15+
16+
console.log(await registry.searchRepositories());
17+
}
18+
19+
Main()
20+
.then(() => {
21+
process.exit();
22+
})
23+
.catch((err) => {
24+
console.log(err);
25+
process.exit(1);
26+
});

libs/idl/idl-interaction-manager/src/lib/idl-interaction-manager.class.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ export class IDLInteractionManager {
5656
*/
5757
constructor(log: Logger, vscodeProDir: string, startupMessage: string) {
5858
this.idl = new IDLProcess(log, vscodeProDir, startupMessage);
59+
60+
this.idl.on(IDL_EVENT_LOOKUP.FAILED_START, (reason) =>
61+
this.handleErrors(`IDL failed to start: ${reason}`)
62+
);
63+
this.idl.on(IDL_EVENT_LOOKUP.CRASHED, (reason) =>
64+
this.handleErrors('IDL crashed or was stopped by the user')
65+
);
5966
}
6067

6168
/**
@@ -510,4 +517,16 @@ export class IDLInteractionManager {
510517
// run again!
511518
this._next();
512519
}
520+
521+
/**
522+
* Handles errors with processing to make sure any currently
523+
* running/pending promises are exited properly
524+
*/
525+
private handleErrors(reason: string) {
526+
if (this._processing !== undefined) {
527+
this._processing.reject(
528+
`${reason}. Current IDL output: ${this.idl.capturedOutput}`
529+
);
530+
}
531+
}
513532
}

libs/idl/idl-process/src/lib/idl-process.class.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,13 @@ export class IDLProcess extends EventEmitter {
171171
return res.idlOutput;
172172
}
173173

174+
/**
175+
* Retrieves the current output from an IDL session
176+
*/
177+
getCurrentOutput() {
178+
return this.capturedOutput;
179+
}
180+
174181
/**
175182
* Let's us know if we are the IDL Machine or not
176183
*/
@@ -394,7 +401,7 @@ export class IDLProcess extends EventEmitter {
394401
args.env.IDL_PROMPT = 'IDL> ';
395402
}
396403

397-
// set variabe that we are in VSCode
404+
// set variable that we are in VSCode
398405
args.env.IDL_FOR_VSCODE = 'true';
399406

400407
// build the command for starting IDL

libs/idl/idl-process/src/lib/wrappers/idl-machine-wrapper.class.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,13 @@ export class IDLMachineWrapper {
267267
*/
268268
});
269269

270+
/**
271+
* When we get a server exit event, call "stop" on our process
272+
*
273+
* If we don't do this, then we don't always detect that IDL has stopped.
274+
*/
270275
this.machine.onNotification('serverExit', () => {
271-
/**
272-
* Nothing to do here
273-
*/
276+
this.stop();
274277
});
275278

276279
/**
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": ["../../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
}
17+
]
18+
}

0 commit comments

Comments
 (0)