Files
DeepTutor/web/tests
Bingxi Zhao (Frank) aac47faed0 fix(web): keep Codex's own injected turns out of an imported transcript
Importing a current Codex session gave the learner a message they never
wrote — a 4KB catalogue of uninstalled plugins — and a session titled
with the first line of it (#1354, follow-up to #1327).

Codex delivers its own context to the model as `role: "user"` items.
Across the 631 rollouts on this machine that is ten distinct tags —
`environment_context`, `recommended_plugins`, `codex_internal_context`,
`skill`, `task`, `heartbeat`, `turn_aborted`, `subagent_notification`,
`codex_delegation`, `send_user_message_question_reply` — and about a
third of every user turn on disk.

Matching the tags would fix today and nothing after it: the list is the
harness's to grow, and a new one walks straight through. What the
injected turns share is a shape, not a name — each is *nothing but*
markup, one or more balanced top-level elements with no prose of the
person's own anywhere around them. So `isHarnessInjectedTurn` consumes
top-level elements and keeps the turn the moment a single character of
anything else remains.

Erring that way is not caution for its own sake, it is the common case:
an attachment turn arrives as `<image name=[Image #1]></image>` followed
by the actual question, 76 of them here, and every one is kept because
the question sits outside the element. Anything ambiguous — a same-named
nested tag, an unclosed one, an attribute holding a `>` — falls out of
the loop unmatched and is kept too. Losing a title to a block we failed
to recognise is a blemish; eating the sentence someone typed is not.

Known to under-catch, deliberately: 181 turns pair the plugin catalogue
with an injected `# AGENTS.md instructions for <path>` in plain markdown,
which has no shape to recognise and would need the literal string. Those
still import.

The legacy `event_msg` path is untouched — it carries none of this (zero
such turns in the corpus), and the tests pin the `<image>` prefix and an
unclosed tag as the two cases that must survive.
2026-09-11 00:07:30 +08:00
..
2026-09-06 13:46:29 +08:00
2026-09-02 04:09:11 +08:00
2026-09-02 04:09:11 +08:00
2026-09-02 04:09:11 +08:00
2026-09-06 13:46:29 +08:00
2026-09-06 13:46:29 +08:00
2026-09-02 04:09:11 +08:00
2026-09-02 04:09:11 +08:00
2026-09-03 01:38:54 +08:00
2026-09-02 04:09:11 +08:00
2026-09-02 04:09:11 +08:00
2026-08-02 13:23:45 +08:00
2026-09-02 04:09:11 +08:00
2026-09-03 01:38:54 +08:00
2026-09-03 01:38:54 +08:00
2026-08-02 13:23:45 +08:00
2026-09-03 01:38:54 +08:00
2026-09-03 01:38:54 +08:00
2026-09-06 13:46:29 +08:00
2026-09-02 04:09:11 +08:00
2026-09-06 13:46:29 +08:00
2026-08-13 18:49:48 +08:00
2026-09-02 04:09:11 +08:00
2026-08-02 13:23:45 +08:00
2026-07-19 16:56:34 +08:00
2026-09-06 13:46:29 +08:00
2026-09-02 04:09:11 +08:00
2026-09-02 04:09:11 +08:00
2026-06-19 20:05:19 +08:00
fix
2026-08-09 22:18:22 +08:00
fix
2026-08-09 22:18:22 +08:00
2026-09-03 01:38:54 +08:00
2026-09-06 13:46:29 +08:00
2026-09-06 13:46:29 +08:00
2026-09-03 01:38:54 +08:00
2026-09-03 01:38:54 +08:00
2026-09-02 04:09:11 +08:00
2026-08-02 13:23:45 +08:00
2026-04-30 23:41:58 +08:00
2026-09-02 04:09:11 +08:00
2026-09-02 04:09:11 +08:00
2026-09-02 04:09:11 +08:00
2026-09-03 01:38:54 +08:00
2026-09-02 04:09:11 +08:00
2026-09-02 04:09:11 +08:00
2026-08-20 14:15:53 +08:00
2026-08-19 17:34:52 +08:00
2026-09-03 01:38:54 +08:00
2026-09-06 13:46:29 +08:00
2026-09-03 01:38:54 +08:00
2026-09-06 13:46:29 +08:00
2026-09-02 04:09:11 +08:00
2026-09-06 13:46:29 +08:00
2026-09-03 01:38:54 +08:00
2026-09-06 13:46:29 +08:00
2026-09-03 01:38:54 +08:00
fix
2026-08-09 22:18:22 +08:00
2026-09-03 01:38:54 +08:00
2026-09-02 04:09:11 +08:00
2026-09-06 13:46:29 +08:00
2026-09-02 04:09:11 +08:00
2026-09-06 13:46:29 +08:00
2026-09-06 13:46:29 +08:00
2026-09-03 01:38:54 +08:00
2026-09-06 13:46:29 +08:00
2026-08-02 13:23:45 +08:00
2026-09-06 13:46:29 +08:00
2026-09-02 04:09:11 +08:00
2026-07-24 18:16:04 +08:00
2026-05-12 02:20:30 +08:00
2026-08-25 02:24:35 +08:00
2026-08-20 14:15:53 +08:00
2026-08-20 14:15:53 +08:00
2026-09-06 13:46:29 +08:00