Skip to content

[codex] Sanitize imported session fallback titles - #29875

Merged
stefanstokic-oai merged 6 commits into
mainfrom
stefanstokic/external-agent-import-title-sanitization
Jul 8, 2026
Merged

[codex] Sanitize imported session fallback titles#29875
stefanstokic-oai merged 6 commits into
mainfrom
stefanstokic/external-agent-import-title-sanitization

Conversation

@stefanstokic-oai

@stefanstokic-oai stefanstokic-oai commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • sanitize Claude-derived fallback titles without changing explicit custom or generated source titles
  • recognize known leading control wrappers, including ide_opened_file, ide_selection, local-command-stdout, and local-command-stderr
  • skip separate control-only user records and use the next meaningful user message as the fallback title
  • use Imported session only when every user record is control-only
  • preserve raw imported messages, previews, and transcript provenance unchanged

Why

Sessions without an explicit source title fall back to user-message content. Claude metadata can arrive as separate leading user records, so stripping only the first record still exposed raw control markup or produced an unhelpful fallback.

Impact

Imported chats now receive readable fallback titles such as Fix auth flow, while the original wrapper-bearing messages remain visible in the imported transcript.

Validation

  • just test -p codex-external-agent-sessions — 37 tests passed
  • just test -p codex-app-server external_agent_config_import_creates_session_rollouts — focused integration test passed
  • just fix -p codex-external-agent-sessions
  • just fix -p codex-app-server
  • just bazel-lock-check
  • just fmt

@stefanstokic-oai
stefanstokic-oai force-pushed the stefanstokic/external-agent-import-title-sanitization branch from bf4b331 to 7638986 Compare July 8, 2026 12:07
@stefanstokic-oai
stefanstokic-oai marked this pull request as ready for review July 8, 2026 12:19
@stefanstokic-oai
stefanstokic-oai merged commit 1d14221 into main Jul 8, 2026
35 checks passed
@stefanstokic-oai
stefanstokic-oai deleted the stefanstokic/external-agent-import-title-sanitization branch July 8, 2026 19:20
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants