Files
magpie/internal/sessions/testdata/codex-aborted-helper.jsonl
T
yetone c7830731ca sessions: a session nothing was said in, which the Sessions page lists, opens and exports instead of "no such session" (#2273)
ListAgent lists a session assemble calls empty (no title, nothing
counted), so it can be cleared away, but Find searched only List(0) and
Get, and both drop it. The row's conversation, Markdown and Terminal
routes all go through Find, so they answered "no such session" for a row
the page itself shows. A real case is Codex's Image Session Helper: a
rollout with session_meta, settings, task_started and turn_aborted only.

Find now falls back to get(), which reports a session's files were found
even when assemble calls it empty, and fills it in the way ListAgent does
(listed(): Resume, Carry, Transcript), so Find finds every session
ListAgent lists. Get and List are unchanged: an empty session still
isn't in the main list and Get still says ok=false for it.

Run:
- TestFindEmptySession (internal/sessions) and TestEmptySessionOpens
  (internal/gui), on a fixture made from the real aborted helper rollout
  (paths and ids redacted). Both fail with Find's fallback broken by
  hand (only taking ok sessions), and pass with it.
- gofmt -l clean; go vet for darwin, linux (nogui) and windows.
- go test -p 4 -timeout 40m ./... with pipefail, sandbox HOME, at
  2b0037f41 plus this change, with four other full suites running on the
  machine: every package green but internal/gateway, whose
  TestOTelFastRequestTranscriptDiscovery/true failed ("request must still
  have a cached discovery miss"). That is #1811, its 2s discovery cache
  window under load; this change doesn't reach that path (TraceSessionIndex
  reads headers itself, never Find or ListAgent). Run alone with -count=10
  with its sibling it passes 10/10. Noted on #1811.
- Real use: a dev-tagged build in a sandbox HOME holding a copy of the
  real empty rollout, sessions feature on. /api/sessions/manage lists it,
  /api/sessions/transcript returns 200 {"parts":[]}, /api/sessions/markdown
  returns 200 with the .md attachment.

Not run: real use on Windows or Linux; the GUI suite (no GUI asset
changes). Whether an aborted helper rollout should count as something
said, and so show in the main list, is left as it was.
2026-10-15 09:40:51 +08:00

6 lines
3.4 KiB
JSON

{"timestamp":"2026-10-09T20:36:39.974Z","ordinal":0,"type":"session_meta","payload":{"creator_user_id":"user-redacted","creator_account_id":"00000000-0000-0000-0000-000000000000","session_id":"01a12261-d5bb-7f03-a40e-c4adca978a90","id":"01a12261-d5bb-7f03-a40e-c4adca978a90","timestamp":"2026-10-09T20:36:39.484Z","cwd":"/work/img","runtime_workspace_roots":["/work/img"],"originator":"miyi-helper","cli_version":"0.162.0-alpha.17.2","source":"vscode","thread_source":"miyi-helper","model_provider":"openai","base_instructions":"[redacted]","history_mode":"paginated","context_window":{"window_id":"01a12261-d5bc-71d2-be26-cb6a7973ce00"}}}
{"timestamp":"2026-10-09T20:36:39.999Z","ordinal":1,"type":"event_msg","payload":{"type":"thread_settings_applied","thread_id":"01a12261-d5bb-7f03-a40e-c4adca978a90","thread_settings":{"model":"gpt-6-sol","model_provider_id":"openai","service_tier":"default","approval_policy":"never","approvals_reviewer":"user","permission_profile":{"type":"managed","file_system":{"type":"restricted","entries":[{"path":{"type":"special","value":{"kind":"root"}},"access":"read"},{"path":{"type":"path","path":"/work/img"},"access":"write"},{"path":{"type":"special","value":{"kind":"slash_tmp"}},"access":"write"},{"path":{"type":"special","value":{"kind":"tmpdir"}},"access":"write"},{"path":{"type":"path","path":"/work/img/.git"},"access":"read","missing_path_behavior":"skip"},{"path":{"type":"path","path":"/work/img/.agents"},"access":"read","missing_path_behavior":"skip"},{"path":{"type":"path","path":"/work/img/.codex"},"access":"read","missing_path_behavior":"skip"},{"path":{"type":"path","path":"/work/img/.aws"},"access":"read","missing_path_behavior":"skip"}]},"network":"restricted"},"cwd":"/work/img","runtime_workspace_roots":["/work/img"],"reasoning_effort":"high","collaboration_mode":{"mode":"default","settings":{"model":"gpt-6-sol","reasoning_effort":"high","developer_instructions":null}},"disabled_plugin_ids":[]}}}
{"timestamp":"2026-10-09T20:36:40.003Z","ordinal":2,"type":"event_msg","payload":{"type":"task_started","turn_attribution":{"turn_id":"01a12261-d7ac-7603-a936-fd0ffad9dae3","turn_trigger":null,"parent_turn_id":null,"initiating_agent_path":null,"root_turn_id":"01a12261-d7ac-7603-a936-fd0ffad9dae3"},"turn_id":"01a12261-d7ac-7603-a936-fd0ffad9dae3","root_turn_id":"01a12261-d7ac-7603-a936-fd0ffad9dae3","started_at":1791578200,"model_context_window":258400,"collaboration_mode_kind":"default"}}
{"timestamp":"2026-10-09T20:36:42.065Z","ordinal":3,"type":"response_item","payload":{"type":"message","id":"msg_01a12261-dfd1-7051-a79d-53690bdf1c1a","role":"developer","content":[{"type":"input_text","text":"<turn_aborted>\nThe previous turn was interrupted on purpose. Any running unified exec processes may still be running in the background. If any tools/commands were aborted, they may have partially executed.\n</turn_aborted>"}],"internal_chat_message_metadata_passthrough":{"turn_id":"01a12261-d7ac-7603-a936-fd0ffad9dae3","create_time":1791578202.065453,"content_item_kinds":["generic.turn_aborted"]}},"metadata":{"client_authored":false,"mcp_attribution":{"status":"none"}}}
{"timestamp":"2026-10-09T20:36:42.067Z","ordinal":4,"type":"event_msg","payload":{"type":"turn_aborted","root_turn_id":"01a12261-d7ac-7603-a936-fd0ffad9dae3","turn_id":"01a12261-d7ac-7603-a936-fd0ffad9dae3","reason":"interrupted","started_at":1791578200,"completed_at":1791578202,"duration_ms":2063}}