fix-chat-tasks

Fix: chat tasks still sort by creation time, not last activity (revert-redo-fix didn't deliver)

Metadata

Statusdone
Assignedagent-2127
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Modelcodex:gpt-5.5
Created2026-05-04T02:44:18.309647852+00:00
Started2026-05-04T02:45:02.061462709+00:00
Completed2026-05-04T03:34:36.977568302+00:00
Tagspriority-high,fix,bug,tui,sort,chat, eval-scheduled
Eval score0.83
└ blocking impact0.90
└ completeness0.85
└ constraint fidelity0.70
└ coordination overhead0.85
└ correctness0.90
└ downstream usability0.80
└ efficiency0.75
└ intent fidelity0.83
└ style adherence0.85

Description

Description

revert-redo-fix (commit f248df699 / c1d1d2fa1) was supposed to add a generic last_interaction_at primitive on every task and sort by it. User reports chats are STILL sorting by creation time, not by recent activity.

User report 2026-05-04: 'not sorting .chat- by actual last activity. but creation time.'

Verified empirically:

$ wg show .chat-35
  Created: 2026-05-03T21:22:09...
  Started: 2026-05-03T21:22:09...
  [no last_interaction_at field]

So either:

  1. revert-redo-fix DIDN'T actually add the field (claim-without-implementation, like fix-supervisor-restart-backoff was)
  2. The field is added but not surfaced in wg show and not consumed by the sort

Investigation + fix

  1. Check src/graph.rs (or wherever Task struct lives) — does last_interaction_at field exist?
  2. Check the apply_sort_mode code path — does it read last_interaction_at or fall back to created_at?
  3. Check the mutation sites (wg log, wg msg send, chat append, state transitions) — do they update last_interaction_at?
  4. Whichever is missing is the gap.

Required behavior

  • Every task has a last_interaction_at field (default to created_at for tasks that have never had activity)
  • Field updates on: state changes, log entries, message sends, chat history append, agent activity (worker output, heartbeat — debounced or excluded depending on render-noise concerns from earlier diagnose)
  • TUI sort within status groups orders by last_interaction_at DESC
  • wg show <task> displays the field
  • Recently-active chat tasks bubble to the top of their status group

Validation

  • Failing test: send a message to chat-A; observe last_interaction_at on chat-A updated
  • Sort test: chats with newer activity appear earlier in the TUI within their status group
  • wg show <task> includes Last interaction: field
  • No regression of revert-redo-fix's existing work (debouncing, sort stability)
  • No regression of fix-tui-graph's reverted constant-scroll bug (sort changes don't trigger viewport jumps)
  • cargo build + cargo test pass
  • Live smoke: in TUI on this project, send a message to one chat. ASSERT that chat bubbles to the top of the chat-task group within ~5 seconds.
  • cargo install --path . was run before claiming done
  • Call wg done at completion

Process note

This is the SECOND time today a 'shipped' task turned out to be claim-without-implementation (after fix-supervisor-restart-backoff at 0.04 evaluator score). The failed-pending-eval state machine is supposed to catch this — investigate WHY revert-redo-fix passed eval despite not delivering the user-visible behavior. May indicate the eval rubric for revert-redo-fix was self-referential (agent's tests passed because they tested the WRONG thing). Out of scope for this task but worth noting.

Depends on

Required by

Log