This website requires JavaScript.
Explore
Help
Sign In
okooooooo
/
magpie
Watch
1
Star
0
Fork
0
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
b84b203256a3ab45221d227d6ae8400a97dedb3f
magpie
/
internal
/
sessions
T
History
yetone
b84b203256
sessions: Droid's (Factory CLI) sessions are listed, with what they spent and
droid --resume <id>
(Discord, 谟竭: "magpie中会话功能中不显示droid 这个agent") — the Sessions view read no droid sessions at all. droid keeps each under ~/.factory/sessions (or $FACTORY_HOME_OVERRIDE/.factory), a folder per cwd (older ones in sessions/ itself): <id>.jsonl starts with a session_start (id, title, cwd/lastCwd, parent + forkedAtMessageId for a fork, callingSessionId for a subagent or /btw), then message events with an ISO timestamp and Anthropic-style content; <id>.settings.json holds the running tokenUsage (inputTokens without the cache, outputTokens with thinking) for its model. The title is the first typed prompt (tagged reminders skipped), else droid's; prompts, replies and tool calls count; a subagent's spend counts in the session that called it, a fork skips the lines it copied; custom:<id> models are priced as the model their customModels entry asks for (magpie's own custom:magpie/<ref> → <ref>), else the id without droid's -[x]-N tail. The total isn't split by turn, so it counts on the day of the last message. Format read from droid 0.231.0's own code. TestDroid fails on the old code (0 sessions) and passes; go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Not tried against a real droid session (no Factory account on this machine).
2026-10-03 15:08:41 +08:00
..
testdata
feat: export gateway and agent conversation waterfalls to Langfuse (
#581
)
2026-10-03 01:43:32 +08:00
agents_test.go
…
call_append_test.go
…
call_cache.go
usage: a Codex call through the gateway that wrote to its upstream's cache is no longer listed a second time as a local session call (laowangba233 on
#589
: 用量中的统计是不是重复了 … 为啥会一个是提供商的一个是本地会话的) — the Usage page drops a Codex rollout's call when it matches a gateway record by session, end time within 2s and equal tokens. Codex reads input_tokens_details.cache_write_tokens from a Responses reply and keeps it as cache_write_input_tokens; the gateway's rUsage read only cached_tokens, so for a call whose upstream told a write the record had CacheWrite 0 and the rollout didn't, the tokens never matched, and the call stayed listed under Local session beside its provider's row. Calls without a write matched, so only some calls were counted twice (Maru Code 92 calls plus 22 "本地会话" in the report). Also, sessions' spent took only the cache read out of Codex's input_tokens, which holds the write too, so such a call's write was counted twice in its own input. Now: the gateway reads cache_write_tokens (input = input_tokens - cached - written) and tells it to Codex when it translates a reply; spent takes the write out of the input as well; and the matcher compares a call's input plus cache writes, its output and its cache reads, so a record and a rollout that split the write differently — an older Codex without the field, or records already in usage.jsonl from before this change — still match, and the duplicates already on a user's page go too. The session caches' versions go up (sessions.json 11, calls-v4) so kept parses are read again, and older calls-v* folders are removed. Under a provider filter the provider ranking still lists the other providers, as it is a picker; the duplicates were what made it read as double counting. TestCodexCacheWriteMatchesGatewayCall (a Codex rollout and gateway records for two calls, one with a 9000-token cache write; with the rollout naming the write and the record not, both naming it, and an older Codex without it: two rows, no Local session row, the provider ranking maru-code alone, unfiltered and filtered to the provider, by QueryPage and LedgerOf; fails without the change with a third row from the log), TestCodexCacheWriteNotInInput and TestResponsesUsageCacheWrite (parse and round trip through what Codex is told) are new and fail without the change; TestCallsCodex's call with a write now expects input 200 (2500 - 2000 read - 300 written). go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui -count=1 ./internal/... under a temp HOME pass (TestFXInState's known TempDir-cleanup flake aside, which passes alone).
2026-10-03 00:47:33 +08:00
calls_review_test.go
…
calls_test.go
usage: a Codex call through the gateway that wrote to its upstream's cache is no longer listed a second time as a local session call (laowangba233 on
#589
: 用量中的统计是不是重复了 … 为啥会一个是提供商的一个是本地会话的) — the Usage page drops a Codex rollout's call when it matches a gateway record by session, end time within 2s and equal tokens. Codex reads input_tokens_details.cache_write_tokens from a Responses reply and keeps it as cache_write_input_tokens; the gateway's rUsage read only cached_tokens, so for a call whose upstream told a write the record had CacheWrite 0 and the rollout didn't, the tokens never matched, and the call stayed listed under Local session beside its provider's row. Calls without a write matched, so only some calls were counted twice (Maru Code 92 calls plus 22 "本地会话" in the report). Also, sessions' spent took only the cache read out of Codex's input_tokens, which holds the write too, so such a call's write was counted twice in its own input. Now: the gateway reads cache_write_tokens (input = input_tokens - cached - written) and tells it to Codex when it translates a reply; spent takes the write out of the input as well; and the matcher compares a call's input plus cache writes, its output and its cache reads, so a record and a rollout that split the write differently — an older Codex without the field, or records already in usage.jsonl from before this change — still match, and the duplicates already on a user's page go too. The session caches' versions go up (sessions.json 11, calls-v4) so kept parses are read again, and older calls-v* folders are removed. Under a provider filter the provider ranking still lists the other providers, as it is a picker; the duplicates were what made it read as double counting. TestCodexCacheWriteMatchesGatewayCall (a Codex rollout and gateway records for two calls, one with a 9000-token cache write; with the rollout naming the write and the record not, both naming it, and an older Codex without it: two rows, no Local session row, the provider ranking maru-code alone, unfiltered and filtered to the provider, by QueryPage and LedgerOf; fails without the change with a third row from the log), TestCodexCacheWriteNotInInput and TestResponsesUsageCacheWrite (parse and round trip through what Codex is told) are new and fail without the change; TestCallsCodex's call with a write now expects input 200 (2500 - 2000 read - 300 written). go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui -count=1 ./internal/... under a temp HOME pass (TestFXInState's known TempDir-cleanup flake aside, which passes alone).
2026-10-03 00:47:33 +08:00
calls.go
sessions: Codex rollouts the Codex app has compressed (.jsonl.zst) are read as the plain ones (
#448
) — with "compress local chat history" on, the Codex app packs older rollout-*.jsonl into rollout-*.jsonl.zst, and rolloutName ended in \.jsonl$, so those sessions, their calls and their usage were gone from Sessions, Usage and the ledger. A .zst rollout is now found, decompressed as it is read (klauspost/compress, already used for dsh's .zstd files; dshOpen now shares openLines), read whole again whenever it changes rather than read on from an offset, and its calls' places are those of its lines decompressed, so a call's content (the detail view) reads the same from either form, and one read before its file was packed still finds it. A rollout there in both forms (the app packing it) is read once, as the plain one, under the same codex:<thread id> key, so the session keeps its id and nothing is counted twice; deleting such a session moves both forms to the trash. TestCodexPackedSessions, TestCodexPackedCalls and TestCodexPackedDelete fail without the change; rollouts packed with the zstd CLI list the same as plain ones in a sandbox CODEX_HOME.
2026-10-02 00:47:11 +08:00
claude.go
…
cline.go
…
codex_titles_test.go
…
codex_titles.go
…
codex_zst_test.go
sessions: Codex rollouts the Codex app has compressed (.jsonl.zst) are read as the plain ones (
#448
) — with "compress local chat history" on, the Codex app packs older rollout-*.jsonl into rollout-*.jsonl.zst, and rolloutName ended in \.jsonl$, so those sessions, their calls and their usage were gone from Sessions, Usage and the ledger. A .zst rollout is now found, decompressed as it is read (klauspost/compress, already used for dsh's .zstd files; dshOpen now shares openLines), read whole again whenever it changes rather than read on from an offset, and its calls' places are those of its lines decompressed, so a call's content (the detail view) reads the same from either form, and one read before its file was packed still finds it. A rollout there in both forms (the app packing it) is read once, as the plain one, under the same codex:<thread id> key, so the session keeps its id and nothing is counted twice; deleting such a session moves both forms to the trash. TestCodexPackedSessions, TestCodexPackedCalls and TestCodexPackedDelete fail without the change; rollouts packed with the zstd CLI list the same as plain ones in a sandbox CODEX_HOME.
2026-10-02 00:47:11 +08:00
codex.go
usage: a Codex call through the gateway that wrote to its upstream's cache is no longer listed a second time as a local session call (laowangba233 on
#589
: 用量中的统计是不是重复了 … 为啥会一个是提供商的一个是本地会话的) — the Usage page drops a Codex rollout's call when it matches a gateway record by session, end time within 2s and equal tokens. Codex reads input_tokens_details.cache_write_tokens from a Responses reply and keeps it as cache_write_input_tokens; the gateway's rUsage read only cached_tokens, so for a call whose upstream told a write the record had CacheWrite 0 and the rollout didn't, the tokens never matched, and the call stayed listed under Local session beside its provider's row. Calls without a write matched, so only some calls were counted twice (Maru Code 92 calls plus 22 "本地会话" in the report). Also, sessions' spent took only the cache read out of Codex's input_tokens, which holds the write too, so such a call's write was counted twice in its own input. Now: the gateway reads cache_write_tokens (input = input_tokens - cached - written) and tells it to Codex when it translates a reply; spent takes the write out of the input as well; and the matcher compares a call's input plus cache writes, its output and its cache reads, so a record and a rollout that split the write differently — an older Codex without the field, or records already in usage.jsonl from before this change — still match, and the duplicates already on a user's page go too. The session caches' versions go up (sessions.json 11, calls-v4) so kept parses are read again, and older calls-v* folders are removed. Under a provider filter the provider ranking still lists the other providers, as it is a picker; the duplicates were what made it read as double counting. TestCodexCacheWriteMatchesGatewayCall (a Codex rollout and gateway records for two calls, one with a 9000-token cache write; with the rollout naming the write and the record not, both naming it, and an older Codex without it: two rows, no Local session row, the provider ranking maru-code alone, unfiltered and filtered to the provider, by QueryPage and LedgerOf; fails without the change with a third row from the log), TestCodexCacheWriteNotInInput and TestResponsesUsageCacheWrite (parse and round trip through what Codex is told) are new and fail without the change; TestCallsCodex's call with a write now expects input 200 (2500 - 2000 read - 300 written). go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui -count=1 ./internal/... under a temp HOME pass (TestFXInState's known TempDir-cleanup flake aside, which passes alone).
2026-10-03 00:47:33 +08:00
content_test.go
…
content.go
sessions: Codex rollouts the Codex app has compressed (.jsonl.zst) are read as the plain ones (
#448
) — with "compress local chat history" on, the Codex app packs older rollout-*.jsonl into rollout-*.jsonl.zst, and rolloutName ended in \.jsonl$, so those sessions, their calls and their usage were gone from Sessions, Usage and the ledger. A .zst rollout is now found, decompressed as it is read (klauspost/compress, already used for dsh's .zstd files; dshOpen now shares openLines), read whole again whenever it changes rather than read on from an offset, and its calls' places are those of its lines decompressed, so a call's content (the detail view) reads the same from either form, and one read before its file was packed still finds it. A rollout there in both forms (the app packing it) is read once, as the plain one, under the same codex:<thread id> key, so the session keeps its id and nothing is counted twice; deleting such a session moves both forms to the trash. TestCodexPackedSessions, TestCodexPackedCalls and TestCodexPackedDelete fail without the change; rollouts packed with the zstd CLI list the same as plain ones in a sandbox CODEX_HOME.
2026-10-02 00:47:11 +08:00
cursor_test.go
sessions: Cursor CLI's chats are on the Sessions page, each listed, opened, resumed and deleted to magpie's trash as another agent's sessions are (@ownsh1p on X: why doesn't the Sessions page show cursor-agent's sessions?) — magpie read the session files of Claude Code, Codex, OpenCode, Pi and the rest, and none of Cursor's. cursor-agent (2026.10.01) keeps a chat in its config folder ($CURSOR_CONFIG_DIR, else $XDG_CONFIG_HOME/cursor, else ~/.cursor) at chats/<md5 of the cwd>/<chat id>/store.db, a SQLite file of two tables as its run store (cursor-sdk-local-runtime's sqlite-blob-store) makes them: meta, whose row "0" is the chat's metadata as JSON in hex (agentId, name — "New Agent" until it has a title — createdAt, lastUsedModel, latestRootBlobId and, for a subagent's chat, subagentInfo with its parent's id), and blobs, content-addressed by the hex of their SHA-256. The root blob is a ConversationStateStructure (protobuf): field 1 the ids of the conversation's messages in order, field 13 the archives a compaction summed up (each one's field 1 the messages it summed up), field 26 when the conversation started. Each message is the AI SDK's JSON ({role, content: a string or parts — text, reasoning, tool-call, tool-result, image, file}). Newer builds also write meta.json beside store.db: title, createdAtMs, updatedAtMs, isSubagent and cwd, the one place the chat's folder is said in words (the folder's name is only its hash). This was read from the installed bundle and matches what other projects that read these stores found; no real chat was opened.
2026-10-02 20:47:22 +08:00
cursor.go
sessions: Cursor CLI's chats are on the Sessions page, each listed, opened, resumed and deleted to magpie's trash as another agent's sessions are (@ownsh1p on X: why doesn't the Sessions page show cursor-agent's sessions?) — magpie read the session files of Claude Code, Codex, OpenCode, Pi and the rest, and none of Cursor's. cursor-agent (2026.10.01) keeps a chat in its config folder ($CURSOR_CONFIG_DIR, else $XDG_CONFIG_HOME/cursor, else ~/.cursor) at chats/<md5 of the cwd>/<chat id>/store.db, a SQLite file of two tables as its run store (cursor-sdk-local-runtime's sqlite-blob-store) makes them: meta, whose row "0" is the chat's metadata as JSON in hex (agentId, name — "New Agent" until it has a title — createdAt, lastUsedModel, latestRootBlobId and, for a subagent's chat, subagentInfo with its parent's id), and blobs, content-addressed by the hex of their SHA-256. The root blob is a ConversationStateStructure (protobuf): field 1 the ids of the conversation's messages in order, field 13 the archives a compaction summed up (each one's field 1 the messages it summed up), field 26 when the conversation started. Each message is the AI SDK's JSON ({role, content: a string or parts — text, reasoning, tool-call, tool-result, image, file}). Newer builds also write meta.json beside store.db: title, createdAtMs, updatedAtMs, isSubagent and cwd, the one place the chat's folder is said in words (the folder's name is only its hash). This was read from the installed bundle and matches what other projects that read these stores found; no real chat was opened.
2026-10-02 20:47:22 +08:00
discovery_test.go
test: every package's tests pass on Windows, and none writes outside its sandbox (the user: 把 Windows 上那几个失败的测试修掉) — on a Windows box the suite failed in most packages, and the root package hung for 25 minutes. Tests set HOME, which os.UserHomeDir ignores on Windows (it reads USERPROFILE), so they read and wrote the runner's own home; each now sets USERPROFILE beside HOME, and Devin's, Goose's, Crush's and Claude Desktop's tests set APPDATA/LOCALAPPDATA, where those keep their files there. said() read the command's output only once it returned, and a pipe holds a few KB on Windows, so magpie model --help blocked forever; it reads while the command writes. Unix permission bits (the gateway key store's 0600 too), exec bits and symlinks Windows lacks are checked only off Windows; TOML strings hold Windows paths as literal strings, JSON as marshalled ones; a URL's path is compared as one. The provider and usage packages run in a home of their own (TestMain, as the gateway's already does), since a CLI's identity kept by a refresh still going when its test ended landed in the runner's ~/.config/magpie — and on a Mac in the user's own. Two product fixes came out of it: imagemcp took a file:///C:/… root or image for the path /C:/…, which doesn't exist on Windows, and now makes a Windows path of it (a host for a UNC share); and session discovery could keep a new Cowork session hidden on Linux, where a folder's mtime is a kernel tick and its size doesn't change, so an entry added within the tick of the last listing left both as they were — a listing made within 2s of its folder's last change is read again, as git does for racy files. TestFilePath and TestRacyDirectoryListedAgain fail without the change. On Windows 11 every package passes (32 of 32) and a run of each package in a fresh home leaves nothing in home, APPDATA or LOCALAPPDATA; on Linux (WSL) and macOS go test -tags nogui ./... passes. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build pass.
2026-10-01 23:15:07 +08:00
discovery.go
test: every package's tests pass on Windows, and none writes outside its sandbox (the user: 把 Windows 上那几个失败的测试修掉) — on a Windows box the suite failed in most packages, and the root package hung for 25 minutes. Tests set HOME, which os.UserHomeDir ignores on Windows (it reads USERPROFILE), so they read and wrote the runner's own home; each now sets USERPROFILE beside HOME, and Devin's, Goose's, Crush's and Claude Desktop's tests set APPDATA/LOCALAPPDATA, where those keep their files there. said() read the command's output only once it returned, and a pipe holds a few KB on Windows, so magpie model --help blocked forever; it reads while the command writes. Unix permission bits (the gateway key store's 0600 too), exec bits and symlinks Windows lacks are checked only off Windows; TOML strings hold Windows paths as literal strings, JSON as marshalled ones; a URL's path is compared as one. The provider and usage packages run in a home of their own (TestMain, as the gateway's already does), since a CLI's identity kept by a refresh still going when its test ended landed in the runner's ~/.config/magpie — and on a Mac in the user's own. Two product fixes came out of it: imagemcp took a file:///C:/… root or image for the path /C:/…, which doesn't exist on Windows, and now makes a Windows path of it (a host for a UNC share); and session discovery could keep a new Cowork session hidden on Linux, where a folder's mtime is a kernel tick and its size doesn't change, so an entry added within the tick of the last listing left both as they were — a listing made within 2s of its folder's last change is read again, as git does for racy files. TestFilePath and TestRacyDirectoryListedAgain fail without the change. On Windows 11 every package passes (32 of 32) and a run of each package in a fresh home leaves nothing in home, APPDATA or LOCALAPPDATA; on Linux (WSL) and macOS go test -tags nogui ./... passes. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build pass.
2026-10-01 23:15:07 +08:00
droid_test.go
sessions: Droid's (Factory CLI) sessions are listed, with what they spent and
droid --resume <id>
(Discord, 谟竭: "magpie中会话功能中不显示droid 这个agent") — the Sessions view read no droid sessions at all. droid keeps each under ~/.factory/sessions (or $FACTORY_HOME_OVERRIDE/.factory), a folder per cwd (older ones in sessions/ itself): <id>.jsonl starts with a session_start (id, title, cwd/lastCwd, parent + forkedAtMessageId for a fork, callingSessionId for a subagent or /btw), then message events with an ISO timestamp and Anthropic-style content; <id>.settings.json holds the running tokenUsage (inputTokens without the cache, outputTokens with thinking) for its model. The title is the first typed prompt (tagged reminders skipped), else droid's; prompts, replies and tool calls count; a subagent's spend counts in the session that called it, a fork skips the lines it copied; custom:<id> models are priced as the model their customModels entry asks for (magpie's own custom:magpie/<ref> → <ref>), else the id without droid's -[x]-N tail. The total isn't split by turn, so it counts on the day of the last message. Format read from droid 0.231.0's own code. TestDroid fails on the old code (0 sessions) and passes; go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Not tried against a real droid session (no Factory account on this machine).
2026-10-03 15:08:41 +08:00
droid.go
sessions: Droid's (Factory CLI) sessions are listed, with what they spent and
droid --resume <id>
(Discord, 谟竭: "magpie中会话功能中不显示droid 这个agent") — the Sessions view read no droid sessions at all. droid keeps each under ~/.factory/sessions (or $FACTORY_HOME_OVERRIDE/.factory), a folder per cwd (older ones in sessions/ itself): <id>.jsonl starts with a session_start (id, title, cwd/lastCwd, parent + forkedAtMessageId for a fork, callingSessionId for a subagent or /btw), then message events with an ISO timestamp and Anthropic-style content; <id>.settings.json holds the running tokenUsage (inputTokens without the cache, outputTokens with thinking) for its model. The title is the first typed prompt (tagged reminders skipped), else droid's; prompts, replies and tool calls count; a subagent's spend counts in the session that called it, a fork skips the lines it copied; custom:<id> models are priced as the model their customModels entry asks for (magpie's own custom:magpie/<ref> → <ref>), else the id without droid's -[x]-N tail. The total isn't split by turn, so it counts on the day of the last message. Format read from droid 0.231.0's own code. TestDroid fails on the old code (0 sessions) and passes; go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Not tried against a real droid session (no Factory account on this machine).
2026-10-03 15:08:41 +08:00
dsh.go
sessions: Codex rollouts the Codex app has compressed (.jsonl.zst) are read as the plain ones (
#448
) — with "compress local chat history" on, the Codex app packs older rollout-*.jsonl into rollout-*.jsonl.zst, and rolloutName ended in \.jsonl$, so those sessions, their calls and their usage were gone from Sessions, Usage and the ledger. A .zst rollout is now found, decompressed as it is read (klauspost/compress, already used for dsh's .zstd files; dshOpen now shares openLines), read whole again whenever it changes rather than read on from an offset, and its calls' places are those of its lines decompressed, so a call's content (the detail view) reads the same from either form, and one read before its file was packed still finds it. A rollout there in both forms (the app packing it) is read once, as the plain one, under the same codex:<thread id> key, so the session keeps its id and nothing is counted twice; deleting such a session moves both forms to the trash. TestCodexPackedSessions, TestCodexPackedCalls and TestCodexPackedDelete fail without the change; rollouts packed with the zstd CLI list the same as plain ones in a sandbox CODEX_HOME.
2026-10-02 00:47:11 +08:00
fingerprint_review_test.go
…
grok_workbuddy_test.go
…
grok.go
…
hermes_compaction_test.go
sessions: Hermes Agent's sessions are on the Sessions page, read from its SQLite stores read-only (
#569
)
2026-10-02 23:02:03 +08:00
hermes_display_test.go
sessions: Hermes Agent's sessions are on the Sessions page, read from its SQLite stores read-only (
#569
)
2026-10-02 23:02:03 +08:00
hermes_display.go
sessions: Hermes Agent's sessions are on the Sessions page, read from its SQLite stores read-only (
#569
)
2026-10-02 23:02:03 +08:00
hermes_test.go
sessions: Hermes Agent's sessions are on the Sessions page, read from its SQLite stores read-only (
#569
)
2026-10-02 23:02:03 +08:00
hermes_usage_residual_test.go
sessions: Hermes Agent's sessions are on the Sessions page, read from its SQLite stores read-only (
#569
)
2026-10-02 23:02:03 +08:00
hermes_visibility_test.go
sessions: Hermes Agent's sessions are on the Sessions page, read from its SQLite stores read-only (
#569
)
2026-10-02 23:02:03 +08:00
hermes.go
sessions: Hermes Agent's sessions are on the Sessions page, read from its SQLite stores read-only (
#569
)
2026-10-02 23:02:03 +08:00
manage_copy_test.go
sessions: preserve symlinks when moving across volumes (
#600
)
2026-10-03 02:17:57 +08:00
manage_test.go
sessions: a Sessions page lists an agent's sessions by folder, to resume or delete, and deleted ones wait in magpie's trash to be restored (TJHHHH on Discord: session management like CC Switch's, deleting above all, in the GUI) — sessions were only seen on Usage, with no way to remove one. The new Sessions tab shows, per agent, every session under the folder it ran in, with its title or first prompt, when, how many messages and how big, a filter, its resume command to copy and, in the Mac app, Open in terminal. Picked sessions (or one, by its own button) are deleted after magpie's own dialog: their files (Claude Code's .jsonl, its subagents folder and what it keeps by the id under file-history, session-env and todos; every segment of a Codex rollout; Qoder's, WorkBuddy's, Pi's, oh-my-pi's) are moved into magpie's folder, trash/sessions/<agent>/<when>-<id>, with a manifest, never erased; Trash lists them and Restore puts them back where they were. A session written to in the last minute is left, and said so, as the agent may still be running it. Agents' own indexes (Codex's session_index.jsonl and state database, Claude Code's history.jsonl) are not edited: they are written while the agent runs, and a stale entry there is harmless. OpenCode, ZCode, dsh, Cline and Grok keep sessions in databases magpie doesn't write, and show no delete. With nine tabs the narrowest header gets a further step that draws the tabs in, and past that they scroll sideways rather than push the page wider (560px in English, or at 150% text). The dialog uses the shared confirmAsk/closeConfirmAsk, as the gateway keys' do. TestListAgent, TestDeleteRestoreClaude, TestDeleteRestoreCodex, TestDeleteActiveRefused (fails without the running check) and TestDeleteOnlyKnownAgents run in a temp HOME; sessions-manage.test.cjs (Chromium, WebKit, en, zh) fails without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass; sessions-manage, click-scroll, old-webkit, text-size, session-terminal, sessions-today, brand, rail-tip, web-page, omarchy, model-test-one, gateway-caller-keys, gateway-connect-keys, api-key-usage, api-key-theme pass.
2026-10-01 22:11:46 +08:00
manage.go
sessions: preserve symlinks when moving across volumes (
#600
)
2026-10-03 02:17:57 +08:00
omp_test.go
…
omp.go
…
opencode_pi_test.go
…
opencode.go
…
pi.go
…
price_dotted_test.go
…
price_test.go
test: every package's tests pass on Windows, and none writes outside its sandbox (the user: 把 Windows 上那几个失败的测试修掉) — on a Windows box the suite failed in most packages, and the root package hung for 25 minutes. Tests set HOME, which os.UserHomeDir ignores on Windows (it reads USERPROFILE), so they read and wrote the runner's own home; each now sets USERPROFILE beside HOME, and Devin's, Goose's, Crush's and Claude Desktop's tests set APPDATA/LOCALAPPDATA, where those keep their files there. said() read the command's output only once it returned, and a pipe holds a few KB on Windows, so magpie model --help blocked forever; it reads while the command writes. Unix permission bits (the gateway key store's 0600 too), exec bits and symlinks Windows lacks are checked only off Windows; TOML strings hold Windows paths as literal strings, JSON as marshalled ones; a URL's path is compared as one. The provider and usage packages run in a home of their own (TestMain, as the gateway's already does), since a CLI's identity kept by a refresh still going when its test ended landed in the runner's ~/.config/magpie — and on a Mac in the user's own. Two product fixes came out of it: imagemcp took a file:///C:/… root or image for the path /C:/…, which doesn't exist on Windows, and now makes a Windows path of it (a host for a UNC share); and session discovery could keep a new Cowork session hidden on Linux, where a folder's mtime is a kernel tick and its size doesn't change, so an entry added within the tick of the last listing left both as they were — a listing made within 2s of its folder's last change is read again, as git does for racy files. TestFilePath and TestRacyDirectoryListedAgain fail without the change. On Windows 11 every package passes (32 of 32) and a run of each package in a fresh home leaves nothing in home, APPDATA or LOCALAPPDATA; on Linux (WSL) and macOS go test -tags nogui ./... passes. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build pass.
2026-10-01 23:15:07 +08:00
purge_test.go
sessions: a session in magpie's trash can be erased for good, one at a time or the whole trash, after magpie's own dialog (
#487
: no way to empty the trash but removing its folder by hand) — the Sessions page's Trash only restored, and said magpie never erases what is in it: remove the folder yourself. Each trashed row now has Delete forever and the Trash an Empty trash, with the count of what is in it; both ask in magpie's dialog, as Delete does (never confirm()), naming the sessions, and Cancel sends nothing. They post /api/sessions/purge with the rows' keys, or all for every session the trash lists; each key is checked as Restore checks it (<agent>/<name>, an agent magpie deletes for, no separators, no . or ..), and its folder, and its agent's, must be real folders in <magpie dir>/trash/sessions, not links, with the session's note (session.json) in it; only that folder goes, its note with it, so the trash lists it no more. Nothing is erased by itself: the note under the Trash now says they are kept until erased there, and magpie never erases them by itself. TestPurgeOne, TestPurgeAll, TestPurgeRefusesOutOfTrash, TestSessionsPurgeRoute and sessions-purge.test.cjs (Chromium, WebKit; en, zh) fail without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass (TestFXInState failed once under load, passes alone and in its package); sessions-manage, sessions-toolbar, click-scroll, old-webkit pass.
2026-10-02 08:20:33 +08:00
qoder.go
…
rollup.go
…
save_test.go
…
sessions_test.go
sessions: Hermes Agent's sessions are on the Sessions page, read from its SQLite stores read-only (
#569
)
2026-10-02 23:02:03 +08:00
sessions.go
sessions: Droid's (Factory CLI) sessions are listed, with what they spent and
droid --resume <id>
(Discord, 谟竭: "magpie中会话功能中不显示droid 这个agent") — the Sessions view read no droid sessions at all. droid keeps each under ~/.factory/sessions (or $FACTORY_HOME_OVERRIDE/.factory), a folder per cwd (older ones in sessions/ itself): <id>.jsonl starts with a session_start (id, title, cwd/lastCwd, parent + forkedAtMessageId for a fork, callingSessionId for a subagent or /btw), then message events with an ISO timestamp and Anthropic-style content; <id>.settings.json holds the running tokenUsage (inputTokens without the cache, outputTokens with thinking) for its model. The title is the first typed prompt (tagged reminders skipped), else droid's; prompts, replies and tool calls count; a subagent's spend counts in the session that called it, a fork skips the lines it copied; custom:<id> models are priced as the model their customModels entry asks for (magpie's own custom:magpie/<ref> → <ref>), else the id without droid's -[x]-N tail. The total isn't split by turn, so it counts on the day of the last message. Format read from droid 0.231.0's own code. TestDroid fails on the old code (0 sessions) and passes; go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Not tried against a real droid session (no Factory account on this machine).
2026-10-03 15:08:41 +08:00
stats_pi_test.go
…
stats_test.go
…
stats_tools_test.go
…
stats.go
…
traces_claude.go
fix: preserve Langfuse coverage for first and auxiliary calls (
#599
)
2026-10-03 11:21:10 +08:00
traces_clients_test.go
fix: preserve Langfuse coverage for first and auxiliary calls (
#599
)
2026-10-03 11:21:10 +08:00
traces_gemini.go
feat: export gateway and agent conversation waterfalls to Langfuse (
#581
)
2026-10-03 01:43:32 +08:00
traces_identity_test.go
fix: preserve Langfuse coverage for first and auxiliary calls (
#599
)
2026-10-03 11:21:10 +08:00
traces_identity.go
fix: preserve Langfuse coverage for first and auxiliary calls (
#599
)
2026-10-03 11:21:10 +08:00
traces_opencode_db.go
feat: export gateway and agent conversation waterfalls to Langfuse (
#581
)
2026-10-03 01:43:32 +08:00
traces_opencode.go
feat: export gateway and agent conversation waterfalls to Langfuse (
#581
)
2026-10-03 01:43:32 +08:00
traces_review_test.go
feat: export gateway and agent conversation waterfalls to Langfuse (
#581
)
2026-10-03 01:43:32 +08:00
traces_snapshot.go
feat: export gateway and agent conversation waterfalls to Langfuse (
#581
)
2026-10-03 01:43:32 +08:00
traces_test.go
fix: defer unfinished session trace roots until completion (
#633
)
2026-10-03 14:28:10 +08:00
traces.go
fix: defer unfinished session trace roots until completion (
#633
)
2026-10-03 14:28:10 +08:00
workbuddy.go
…
zcode.go
…