Skip to content

Commit 65ea800

Browse files
authored
refactor: drop explanatory comments, tighten retry test assertion
Generated-By: PostHog Code Task-Id: 88d22f31-54f1-4121-bd68-40c5958bb2cd
1 parent 1e32787 commit 65ea800

3 files changed

Lines changed: 11 additions & 17 deletions

File tree

packages/core/src/sessions/sessionService.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,9 +1299,6 @@ export class SessionService {
12991299
session.channel = result.channel;
13001300
session.status = "connected";
13011301
session.adapter = adapter;
1302-
// Capture the run configuration so retry/reset flows (clearSessionError)
1303-
// can recreate the session with the user's original choices instead of
1304-
// falling back to DEFAULT_GATEWAY_MODEL and losing e.g. a Fable selection.
13051302
session.model = model;
13061303
session.executionMode = executionMode;
13071304
session.reasoningLevel = reasoningLevel;
@@ -3413,8 +3410,6 @@ export class SessionService {
34133410
"Unable to reach server. Please check your connection.",
34143411
);
34153412
}
3416-
// Preserve the original run configuration so the retried session keeps
3417-
// the user's model/adapter/mode instead of reverting to defaults.
34183413
await this.createNewLocalSession(
34193414
taskId,
34203415
taskTitle,

packages/core/src/sessions/sessionServiceRetryConfig.test.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,16 @@ describe("SessionService.clearSessionError retry config", () => {
7777

7878
await service.clearSessionError("task-1", "/repo");
7979

80-
// args: taskId, taskTitle, repoPath, auth, initialPrompt,
81-
// executionMode, adapter, model, reasoningLevel
82-
const call = createNewLocalSession.mock.calls[0];
83-
expect(call[5]).toBe("auto"); // executionMode
84-
expect(call[6]).toBe("claude"); // adapter
85-
expect(call[7]).toBe("claude-fable-5"); // model
86-
expect(call[8]).toBe("high"); // reasoningLevel
80+
expect(createNewLocalSession).toHaveBeenCalledWith(
81+
"task-1",
82+
"Test task",
83+
"/repo",
84+
{ client: {} },
85+
session.initialPrompt,
86+
"auto", // executionMode
87+
"claude", // adapter
88+
"claude-fable-5", // model
89+
"high", // reasoningLevel
90+
);
8791
});
8892
});

packages/shared/src/sessions.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ export interface AgentSession {
6464
processedLineCount?: number;
6565
framework?: "claude";
6666
adapter?: Adapter;
67-
/**
68-
* Run configuration captured at session creation so retry/reset flows can
69-
* recreate the session with the user's original choices instead of silently
70-
* falling back to defaults (e.g. reverting a Fable run to the default model).
71-
*/
7267
model?: string;
7368
executionMode?: ExecutionMode;
7469
reasoningLevel?: string;

0 commit comments

Comments
 (0)