Elffuss BraidHub

kikocis/continue public

use history.load
Changesetcb40c4d7041330965d04b7343399b17351021fd5cdb4cbcbe2b30c02825bd45a
Authoruinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-07-15 12:56 +05:30
Committeruinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-07-15 12:56 +05:30
Parents7ceef566a463

Browse the files at this changeset

7 files changed

modified core/core.ts +0 −4
@@ -292,10 +292,6 @@
292292 historyManager.clearAll();
293293 });
294294
295- on("history/getSessionData", (msg) => {
296- return historyManager.getSessionData(msg.data.id);
297- });
298-
299295 on("devdata/log", async (msg) => {
300296 void DataLogger.getInstance().logDevData(msg.data);
301297 });
modified core/protocol/core.ts +0 −1
@@ -67,7 +67,6 @@
6767 "history/load": [{ id: string }, Session];
6868 "history/save": [Session, void];
6969 "history/clear": [undefined, void];
70- "history/getSessionData": [{ id: string }, string];
7170 "devdata/log": [DevDataLogEvent, void];
7271 "config/addOpenAiKey": [string, void];
7372 "config/addModel": [
modified core/protocol/passThrough.ts +0 −1
@@ -15,7 +15,6 @@
1515 "history/load",
1616 "history/save",
1717 "history/clear",
18- "history/getSessionData",
1918 "devdata/log",
2019 "config/addModel",
2120 "config/newPromptFile",
modified core/util/history.test.ts +0 −14
@@ -37,12 +37,6 @@
3737 sessionId: testSessionId,
3838 });
3939 });
40-
41- test("Getting session data for non-existent session throws error", () => {
42- expect(() => {
43- historyManager.getSessionData(testSessionId);
44- }).toThrow();
45- });
4640 });
4741
4842 describe("Full session lifecycle", () => {
@@ -61,14 +55,6 @@
6155 expect(retrievedSession).toEqual(testSession);
6256 });
6357
64- test("Getting session data returns formatted JSON string", () => {
65- const sessionData = historyManager.getSessionData(testSession.sessionId);
66- const parsed = JSON.parse(sessionData);
67- expect(parsed.sessionId).toBe(testSession.sessionId);
68- expect(parsed.title).toBe(testSession.title);
69- expect(parsed.workspaceDirectory).toBe(testSession.workspaceDirectory);
70- });
71-
7258 test("Saving session with new title updates session", () => {
7359 const modifiedSession = { ...testSession };
7460 modifiedSession.title = `Edited: ${testSession.title}`;
modified core/util/history.ts +0 −13
@@ -95,19 +95,6 @@
9595 }
9696 }
9797
98- getSessionData(sessionId: string): string {
99- try {
100- const sessionFile = getSessionFilePath(sessionId);
101- if (!fs.existsSync(sessionFile)) {
102- throw new Error(`Session file ${sessionFile} does not exist`);
103- }
104- const fileContent = fs.readFileSync(sessionFile, "utf8");
105- return JSON.stringify(JSON.parse(fileContent), null, 2);
106- } catch (e) {
107- throw new Error(`Error reading session data: ${e}`);
108- }
109- }
110-
11198 save(session: Session) {
11299 // Save the main session json file
113100 // Explicitely rewriting here to influence the written key order in the file!
modified extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt +0 −1
@@ -81,7 +81,6 @@
8181 "history/load",
8282 "history/save",
8383 "history/clear",
84- "history/getSessionData",
8584 "devdata/log",
8685 "config/addModel",
8786 "config/newPromptFile",
modified gui/src/pages/config/HelpCenterSection.tsx +3 −3
@@ -23,14 +23,14 @@
2323
2424 const handleViewSessionData = async () => {
2525 try {
26- const sessionData = await ideMessenger.request("history/getSessionData", {
26+ const sessionData = await ideMessenger.request("history/load", {
2727 id: currentSession.id,
2828 });
2929
3030 if (sessionData.status === "success") {
3131 await ideMessenger.request("showVirtualFile", {
32- name: "currentSessionData.json",
33- content: sessionData.content,
32+ name: `${sessionData.content.title}.json`,
33+ content: JSON.stringify(sessionData.content, null, 2),
3434 });
3535 }
3636 } catch (error) {