Skip to content

Commit a7def6f

Browse files
committed
fix(tools): report unknown write lists for runs without a report, echo the requested milestone
1 parent e06eecd commit a7def6f

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎apps/sim/lib/mothership/tools/server/tests.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ function failures(report: StoredTestReport | null) {
5050
* Each write a run stubbed because no mock answered it, once, as `block → tool` (a block answered
5151
* whole by its name alone): a test that passes may still lean on a placeholder. The list is partial
5252
* when `omittedCalls` (stubbed calls a run's full list left out) or `omittedRuns` (runs past the
53-
* per-file cap, whose writes went unrecorded) is nonzero.
53+
* per-file cap, whose writes went unrecorded) is nonzero, and unknown (null) for a run with no
54+
* report, such as one that errored before the sandbox returned.
5455
*/
5556
function unmockedWrites(report: StoredTestReport | null) {
56-
const executions = Object.values(report?.sideEffects?.executions ?? {})
57+
if (!report) return null
58+
const executions = Object.values(report.sideEffects?.executions ?? {})
5759
const sites = executions.flatMap((execution) =>
5860
execution.stubbed.map(({ block, blockId, tool }) => {
5961
const site = block ?? blockId ?? 'unnamed block'
@@ -63,7 +65,7 @@ function unmockedWrites(report: StoredTestReport | null) {
6365
return {
6466
sites: [...new Set(sites)],
6567
omittedCalls: executions.reduce((total, execution) => total + execution.omitted.stubbed, 0),
66-
omittedRuns: report?.sideEffects?.omittedExecutions ?? 0,
68+
omittedRuns: report.sideEffects?.omittedExecutions ?? 0,
6769
}
6870
}
6971

‎apps/sim/tools/github/create_issue.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,16 @@ export const createIssueV2Tool: ToolConfig<CreateIssueParams, any> = {
173173

174174
/**
175175
* A dry run's placeholder holds what the call sets on the issue it creates, each label and
176-
* assignee by the name it sends; its id, number, state, URL and times stay placeholders.
176+
* assignee by the name it sends and the milestone by its number (null when none is set); its
177+
* id, number, state, URL and times stay placeholders.
177178
*/
178179
dryRunOutput: (params) => {
179180
const { labels, assignees, ...issue } = requestedIssue(params)
180181
return {
181182
...issue,
182183
...(labels ? { labels: labels.map((name) => ({ name })) } : {}),
183184
...(assignees ? { assignees: assignees.map((login) => ({ login })) } : {}),
185+
milestone: params.milestone ? { number: params.milestone } : null,
184186
}
185187
},
186188

0 commit comments

Comments
 (0)