Skip to content

feat: show T3 thread titles in Codex notifications - #62

Draft
obviousbread wants to merge 1 commit into
mylee04:mainfrom
obviousbread:agent/t3-thread-titles
Draft

feat: show T3 thread titles in Codex notifications#62
obviousbread wants to merge 1 commit into
mylee04:mainfrom
obviousbread:agent/t3-thread-titles

Conversation

@obviousbread

Copy link
Copy Markdown
Contributor

Closes #61.

What this does

Adds optional, read-only T3 Code context resolution for Codex completion notifications.

When a Codex notify payload contains a thread-id, Code-Notify checks whether that Codex thread is associated with a local T3 Code thread. If it is, the T3 thread title is used as the notification context instead of the workspace basename.

Before: Task Complete - WORK
After:  Task Complete - Investigate missing desktop notifications

Standalone Codex behavior is unchanged.

How it works

T3 Code stores its local state in ~/.t3/userdata/state.sqlite. The resolver:

  1. Extracts thread-id from the existing Codex notify payload.
  2. Opens the T3 database read-only.
  3. Finds a Codex runtime whose resume_cursor_json.threadId matches the payload.
  4. Resolves the associated title from projection_threads.
  5. Returns the title only when it is a non-empty string.

Missing files, database locks, incompatible schemas, malformed JSON, unavailable Python, and unmatched threads all fall back to the existing workspace-name resolution.

Design decisions

  • Best-effort: notification delivery never depends on the T3 lookup succeeding.
  • Read-only: Code-Notify does not modify T3 state.
  • Exact matching: the resolver uses the Codex thread ID instead of guessing from the most recently updated T3 thread.
  • No new dependency: it reuses Python's standard sqlite3 module, which Code-Notify already uses for Codex state inspection.
  • No new provider: T3 Code is optional context for Codex, not a separate notification provider.

Scope

This PR does not modify T3 Code or change Code-Notify's default wording, emoji, delivery channels, suppression rules, or fallback behavior.

Testing

  • Extended tests/test-codex-notify.sh with a temporary T3 SQLite fixture.
  • Covered exact thread-ID matching, an unrelated malformed runtime payload, missing-T3 fallback, existing CLI fallback, and Codex Desktop duplicate suppression.
  • make test: 28 passed, 0 failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: show T3 Code thread titles in Codex notifications

1 participant