Repository navigation
feat(sessions): add pi as session source for browsing pi coding agent sessions #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,8 +28,8 @@ export function createSessionActionMethods(options = {}) { | |
| let error = ''; | ||
| if (!source) { | ||
| error = '缺少 source 参数'; | ||
| } else if (source !== 'codex' && source !== 'claude') { | ||
| error = 'source 仅支持 codex 或 claude'; | ||
| } else if (source !== 'codex' && source !== 'claude' && source !== 'gemini' && source !== 'codebuddy' && source !== 'pi') { | ||
| error = 'source 仅支持 codex、claude、gemini、codebuddy 或 pi'; | ||
|
Comment on lines
+31
to
+32
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Include Pi in the destructive-action capability guard. Lines [31]-[32] now accept Pi for standalone session URLs, but 🤖 Prompt for AI Agents |
||
| } | ||
| if (!sessionId && !filePath) { | ||
| error = error ? `${error},还缺少 sessionId 或 filePath` : '缺少 sessionId 或 filePath 参数'; | ||
|
|
@@ -67,7 +67,15 @@ export function createSessionActionMethods(options = {}) { | |
| return; | ||
| } | ||
|
|
||
| const sourceLabel = context.params.source === 'codex' ? 'Codex' : 'Claude Code'; | ||
| const sourceLabel = context.params.source === 'codex' | ||
| ? 'Codex' | ||
| : (context.params.source === 'claude' | ||
| ? 'Claude Code' | ||
| : (context.params.source === 'gemini' | ||
| ? 'Gemini CLI' | ||
| : (context.params.source === 'pi' | ||
| ? 'Pi' | ||
| : (context.params.source === 'codebuddy' ? 'CodeBuddy Code' : context.params.source)))); | ||
| this.activeSession = { | ||
| source: context.params.source, | ||
| sourceLabel, | ||
|
|
@@ -96,7 +104,7 @@ export function createSessionActionMethods(options = {}) { | |
| buildSessionStandaloneUrl(session) { | ||
| if (!session) return ''; | ||
| const source = typeof session.source === 'string' ? session.source.trim().toLowerCase() : ''; | ||
| if (!source || (source !== 'codex' && source !== 'claude')) return ''; | ||
| if (!source || (source !== 'codex' && source !== 'claude' && source !== 'gemini' && source !== 'codebuddy' && source !== 'pi')) return ''; | ||
| const sessionId = typeof session.sessionId === 'string' ? session.sessionId.trim() : ''; | ||
| const filePath = typeof session.filePath === 'string' ? session.filePath.trim() : ''; | ||
| if (!sessionId && !filePath) return ''; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Carry Pi through every chart aggregation field.
Line [405] now admits Pi into
buildUsageChartGroups, but the function still treats every non-Codex session as Claude (Lines [491]-[494]), keeps only Codex/Claude counters and source totals (Lines [440]-[453]), and maps source labels the same way (Lines [522]-[524], [594]). For Pi sessions,sourceMessageTotals[source] += messageCountwrites to a missingpiproperty and producesNaN, while totals and labels report Pi as Claude. Add Pi to bucket counters, source totals/share, labels, and total-session calculations.🤖 Prompt for AI Agents