fix(ghidra): report progress while startup is pending (#1877)
Forward Ghidra startup waiting observations through the existing progress reporter. Count emitted MCP status notifications and omit the unknown total to keep progress strictly increasing. Verified with focused tests, type/lint/docs checks, packaging and actual installed Windows timeout/recovery workflows. Native first-query speed and large-target memory remain open under #1065. Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
This commit is contained in:
@@ -22,8 +22,10 @@ export const mcpProgressReporter = (
|
||||
method: "notifications/progress",
|
||||
params: {
|
||||
progressToken: token,
|
||||
progress: update.completed,
|
||||
...(update.total === null ? {} : { total: update.total }),
|
||||
// Status phases can repeat their work count while waiting. The
|
||||
// protocol requires every notification to advance; count emitted
|
||||
// observations without inventing a total amount of analysis work.
|
||||
progress: update.sequence,
|
||||
message: `${update.phase}: ${update.message}`,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -67,8 +67,10 @@ describe("derived MCP operation boundary", () => {
|
||||
);
|
||||
|
||||
expect(result).toEqual({ ok: true, value: "complete" });
|
||||
expect(notifications.map(({ params }) => params?.progress)).toEqual([0, 2]);
|
||||
expect(notifications.every(({ params }) => params?.total === 2)).toBe(true);
|
||||
expect(notifications.map(({ params }) => params?.progress)).toEqual([1, 2]);
|
||||
expect(
|
||||
notifications.every(({ params }) => params?.total === undefined),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("projects synchronous computation failures into a typed result", async () => {
|
||||
|
||||
Reference in New Issue
Block a user