Skip to content

feat(adapters): codex T4 — notify hook wiring for automatic session capture #388

Description

@plind-junior

follows #387: with vouch capture ingest-codex available, codex can self-capture the way claude-code T4 does, using the one lifecycle hook codex offers — the notify setting in config.toml, which runs an external program with a json payload on events like agent-turn-complete.

proposed change

  • extend adapters/codex/config.toml with a notify entry that invokes the ingest path (thin wrapper: read the payload, call vouch capture ingest-codex for the session in question). the wrapper must exit 0 even on failure — a capture failure must never break the user's codex turn, same rule as capture observe in src/vouch/cli.py.
  • this makes T1 carry hook config, so it depends on toml_merge (feat(adapters): toml_merge install strategy — codex T1 must merge into an existing .codex/config.toml #384) landing first — the current clobber-or-skip copy semantics would either lose the user's config or never install the hook.
  • respect an existing user notify value: codex allows a single notify program, so the merge must not overwrite one that's already set — report it as skipped with a manual-step hint instead.
  • decide the finalize policy in implementation: notify fires per turn, not per session-end. options are idempotent re-ingest on every turn (the dedup guard from feat(capture): ingest codex session rollouts into review-gated session summaries #387 updates rather than duplicates) or only ingesting sessions past a staleness threshold (is_stale_buffer in src/vouch/capture.py is the precedent).

review gate & scope

wiring only — the capture path itself (#387) already routes everything through propose_page; nothing here touches approval. project-local config, no home-directory writes.

acceptance criteria

  • fresh codex install wires notify so a completed codex session lands as a PENDING session-summary proposal with no manual steps
  • an existing user notify setting is never silently overwritten
  • capture failures exit 0 and never surface as errors inside the codex session
  • behavior documented in adapters/codex/README.md
  • install path covered in tests/test_install_adapter.py; hook-driven ingest covered in the capture tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    adaptersagent host adapters and install manifestsenhancementNew feature or requestsize: S50-199 changed non-doc lines

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions