@syengup/friday-channel-next 0.1.24 → 0.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -110,10 +110,14 @@ function readAgentSessions(agentId) {
110
110
  continue;
111
111
  const entry = rawEntry;
112
112
  const canonicalKey = toCanonicalSessionKey(agentId, storeKey);
113
- // Drop internal/system sessions and subagent links.
113
+ // Drop internal/system sessions and subagent links. We key only on
114
+ // `spawnedBy`/`subagentRole` (plus the `subagent:` prefix in
115
+ // isInternalSessionKey) — NOT on `parentSessionKey`, which real user
116
+ // conversations (e.g. webchat sessions branched off another session) also
117
+ // carry and which would otherwise be wrongly excluded from the sidebar.
114
118
  if (isInternalSessionKey(canonicalKey, storeKey))
115
119
  continue;
116
- if (entry.spawnedBy || entry.subagentRole || entry.parentSessionKey)
120
+ if (entry.spawnedBy || entry.subagentRole)
117
121
  continue;
118
122
  // Drop archived/empty sessions (transcript moved away or never written).
119
123
  if (!hasLiveTranscript(entry, storePath))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syengup/friday-channel-next",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "OpenClaw Friday Next Apple channel plugin",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -143,4 +143,34 @@ describe("handleHistorySessions", () => {
143
143
  const keys = JSON.parse(res.body).sessions.map((s: any) => s.sessionKey);
144
144
  expect(keys).toEqual(["agent:main:main"]);
145
145
  });
146
+
147
+ it("keeps real conversations that merely carry a parentSessionKey", async () => {
148
+ setForward(
149
+ { agents: { list: [{ id: "main" }] } },
150
+ {
151
+ main: {
152
+ // Webchat session branched off another session: has parentSessionKey
153
+ // but is a genuine user conversation — must be surfaced.
154
+ "agent:main:dashboard:b91ad945": {
155
+ sessionId: "wc",
156
+ updatedAt: 9,
157
+ parentSessionKey: "agent:main:fridaynext:mq5zn7dp",
158
+ sessionFile: transcript("wc.jsonl"),
159
+ },
160
+ // Real subagent fork (spawnedBy) must still be filtered.
161
+ "agent:main:fork": {
162
+ sessionId: "fk",
163
+ updatedAt: 8,
164
+ spawnedBy: "agent:main:main",
165
+ parentSessionKey: "agent:main:main",
166
+ sessionFile: transcript("fk.jsonl"),
167
+ },
168
+ },
169
+ },
170
+ );
171
+ const res = new MockRes();
172
+ await handleHistorySessions(makeReq(AUTH), res as any);
173
+ const keys = JSON.parse(res.body).sessions.map((s: any) => s.sessionKey);
174
+ expect(keys).toEqual(["agent:main:dashboard:b91ad945"]);
175
+ });
146
176
  });
@@ -125,9 +125,13 @@ function readAgentSessions(agentId: string): FridayHistorySessionSummary[] {
125
125
  const entry = rawEntry as Record<string, unknown>;
126
126
  const canonicalKey = toCanonicalSessionKey(agentId, storeKey);
127
127
 
128
- // Drop internal/system sessions and subagent links.
128
+ // Drop internal/system sessions and subagent links. We key only on
129
+ // `spawnedBy`/`subagentRole` (plus the `subagent:` prefix in
130
+ // isInternalSessionKey) — NOT on `parentSessionKey`, which real user
131
+ // conversations (e.g. webchat sessions branched off another session) also
132
+ // carry and which would otherwise be wrongly excluded from the sidebar.
129
133
  if (isInternalSessionKey(canonicalKey, storeKey)) continue;
130
- if (entry.spawnedBy || entry.subagentRole || entry.parentSessionKey) continue;
134
+ if (entry.spawnedBy || entry.subagentRole) continue;
131
135
  // Drop archived/empty sessions (transcript moved away or never written).
132
136
  if (!hasLiveTranscript(entry, storePath)) continue;
133
137