Skip to content

Commit 0619059

Browse files
committed
fix: use model session titles and bump version
1 parent 0e5c81a commit 0619059

File tree

3 files changed

+4
-22
lines changed

3 files changed

+4
-22
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ode",
3-
"version": "0.0.82",
3+
"version": "0.0.83",
44
"description": "Coding anywhere with your coding agents connected",
55
"module": "packages/core/index.ts",
66
"type": "module",

packages/agents/session-state/shared.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,9 @@ export function extractSessionTitle(value: unknown): string | undefined {
6868
return trimmed;
6969
};
7070

71-
const normalizeSlug = (candidate: unknown): string | undefined => {
72-
if (typeof candidate !== "string") return undefined;
73-
const trimmed = candidate.trim();
74-
if (!trimmed) return undefined;
75-
if (trimmed.startsWith("new-session")) return undefined;
76-
const spaced = trimmed.replace(/[-_]+/g, " ").trim();
77-
if (!spaced) return undefined;
78-
return spaced.replace(/\b\w/g, (char) => char.toUpperCase());
79-
};
80-
8171
if (!value || typeof value !== "object") return undefined;
8272

8373
const queue: unknown[] = [value];
84-
let firstSlug: string | undefined;
8574

8675
while (queue.length > 0) {
8776
const current = queue.shift();
@@ -96,26 +85,19 @@ export function extractSessionTitle(value: unknown): string | undefined {
9685
const directTitle = normalizeTitle(record.title);
9786
if (directTitle) return directTitle;
9887

99-
if (!firstSlug) {
100-
firstSlug = normalizeSlug(record.slug) ?? firstSlug;
101-
}
102-
10388
const info = record.info;
10489
if (info && typeof info === "object" && !Array.isArray(info)) {
10590
const infoRecord = info as Record<string, unknown>;
10691
const infoTitle = normalizeTitle(infoRecord.title);
10792
if (infoTitle) return infoTitle;
108-
if (!firstSlug) {
109-
firstSlug = normalizeSlug(infoRecord.slug) ?? firstSlug;
110-
}
11193
}
11294

11395
for (const nested of Object.values(record)) {
11496
if (nested && typeof nested === "object") queue.push(nested);
11597
}
11698
}
11799

118-
return firstSlug;
100+
return undefined;
119101
}
120102

121103
export function extractPrefixedRecord<TRecord>(

packages/agents/test/session-inspector.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ describe("session inspector", () => {
175175
expect(preview).toContain("`Grep`");
176176
});
177177

178-
it("falls back to session slug when OpenCode title is generic", () => {
178+
it("ignores session slug when OpenCode title is generic", () => {
179179
const startedAt = Date.now();
180180
const state = buildSessionMessageState([
181181
{
@@ -195,7 +195,7 @@ describe("session inspector", () => {
195195
},
196196
]);
197197

198-
expect(state.sessionTitle).toBe("Neon Harbor");
198+
expect(state.sessionTitle).toBeUndefined();
199199
});
200200

201201
it("prefers summarized title over sibling slug", () => {

0 commit comments

Comments
 (0)