pinokiod 7.5.6 → 7.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/kernel/shell.js +0 -1
- package/kernel/shells.js +1 -1
- package/package.json +1 -1
- package/test/shells-live-error.test.js +24 -2
package/kernel/shell.js
CHANGED
package/kernel/shells.js
CHANGED
|
@@ -601,7 +601,7 @@ class Shells {
|
|
|
601
601
|
liveEventHandlersClosed = true
|
|
602
602
|
break
|
|
603
603
|
}
|
|
604
|
-
if (isBreakHandler && liveErrors.size > 0) {
|
|
604
|
+
if (isBreakHandler && params.input !== true && liveErrors.size > 0) {
|
|
605
605
|
sh.continue(liveEventBuffer)
|
|
606
606
|
liveEventHandlersClosed = true
|
|
607
607
|
break
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ const test = require('node:test')
|
|
|
2
2
|
const assert = require('node:assert/strict')
|
|
3
3
|
const Module = require('node:module')
|
|
4
4
|
|
|
5
|
-
async function runWithFakeShell ({ platform = 'win32', chunks, response, waitForBreak = false, on }) {
|
|
5
|
+
async function runWithFakeShell ({ platform = 'win32', chunks, response, waitForBreak = false, on, extraParams = {} }) {
|
|
6
6
|
class FakeShell {
|
|
7
7
|
constructor () {
|
|
8
8
|
this.id = 'fake-shell'
|
|
@@ -75,7 +75,11 @@ async function runWithFakeShell ({ platform = 'win32', chunks, response, waitFor
|
|
|
75
75
|
}
|
|
76
76
|
const output = []
|
|
77
77
|
const shells = new Shells(kernel)
|
|
78
|
-
const
|
|
78
|
+
const runParams = { message: 'python wgp.py', ...extraParams }
|
|
79
|
+
if (on !== undefined) {
|
|
80
|
+
runParams.on = on
|
|
81
|
+
}
|
|
82
|
+
const result = await shells.run(runParams, { cwd: '/tmp/app' }, (stream) => {
|
|
79
83
|
output.push(stream.raw || '')
|
|
80
84
|
})
|
|
81
85
|
|
|
@@ -130,6 +134,24 @@ test('shell.run resolves an interactive run on a real live break match', async (
|
|
|
130
134
|
assert.deepEqual(result.error, ['error:'])
|
|
131
135
|
})
|
|
132
136
|
|
|
137
|
+
test('shell.run does not live-break automatic errors for input sessions', async () => {
|
|
138
|
+
const { output, result } = await runWithFakeShell({
|
|
139
|
+
platform: 'darwin',
|
|
140
|
+
chunks: [
|
|
141
|
+
"ModuleNotFoundError: No module named 'charset_normalizer'\n"
|
|
142
|
+
],
|
|
143
|
+
response: "ModuleNotFoundError: No module named 'charset_normalizer'\nagent continues",
|
|
144
|
+
extraParams: {
|
|
145
|
+
input: true
|
|
146
|
+
}
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
assert.equal(output.some((chunk) => chunk.includes('# input.event')), true)
|
|
150
|
+
assert.match(result.response, /agent continues/)
|
|
151
|
+
assert.deepEqual(result.event[0], 'Error:')
|
|
152
|
+
assert.deepEqual(result.error, ['Error:'])
|
|
153
|
+
})
|
|
154
|
+
|
|
133
155
|
test('shell.run does not return an error for a live match covered by break:false', async () => {
|
|
134
156
|
const { result } = await runWithFakeShell({
|
|
135
157
|
platform: 'darwin',
|