Skip to content

fix(codex): show who sent a group-chat request - #170709

Merged
steipete merged 7 commits into
openclaw:mainfrom
sunlit-deng:sunlit/fix/issue-170159
Oct 13, 2026
Merged

steipete merged 7 commits into
openclaw:mainfrom
sunlit-deng:sunlit/fix/issue-170159

Conversation

@sunlit-deng

@sunlit-deng sunlit-deng commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #170159: in a group conversation, Codex can answer the newest participant as if they were the previous speaker because the current request lacks an adjacent sender label.

User Impact

The current request carries the admitted sender's stable identity and available display labels. Name-only metadata remains unattributed. No configuration, migration, or public API change is required.

Why This Change Was Made

Both context-engine and continuity projection now pass the admitted current message to the existing Codex projection owner, which reuses the same bounded sender formatter as historical messages. Only the generated label is neutralized for native skill/plugin mention syntax; intentional mentions in the request remain intact.

Original fix by @sunlit-deng; maintainer cleanup removes a redundant label intermediate, replaces a metadata cast with the existing record reader, and strengthens regression coverage. A neighboring question-refresh fixture now flushes zero-delay question delivery without advancing its fake run deadline during cold asynchronous setup. This preserves the generated-metadata intent of #150490.

Evidence

  • Source/history confirmation: main 87b0295824773 still appends the bare prompt after Current user request:. Historical labels already use the sender formatter and native-mention neutralizer. Sibling Codex source confirms explicit skill/plugin selection scans text inputs.
  • Regressions in context-engine-projection.test.ts: places stable current sender provenance beside the request (history: %s) covers history and empty-history requests; does not infer current sender identity from display names without a stable ID covers anonymous metadata.
  • Regressions at native turn/start in run-attempt.context-engine.test.ts: bootstraps and assembles a compaction summary before the Codex turn starts and places inert sender provenance beside a continuity-projected request without escaping request mentions verify adjacent attribution, inert $deploy/plugin display metadata, and preserved intentional request mentions.
  • Local format: oxfmt --write passed on all five changed files. Local lint: direct oxlint --no-ignore --tsconfig config/tsconfig/oxlint.core.json passed (initial 4-file pass and follow-up 2-file CI-repair pass, 5 unique files, 231 rules, zero diagnostics); the temporary config excludes only the unrelated ui/**/*.tsx Solid override because its plugin is unavailable in this nested install. All applicable rules remain enabled. git diff --check passed.
  • Prescribed Codex branch autoreview and follow-up CI-fix review: scoped-clean, no actionable P0–P2 findings.
  • Diff versus main: production +21/−21 (net 0); tests +124/−5 (net +119); docs +0/−0. No changelog edits.
  • PR CI is the test gate: exact-head run 38361392407 passed for eefc97130d85609fde1356fe7d52107fb98056f7 (30 successful jobs, 30 inapplicable jobs skipped), including production types, test types, lint, and repository checks. The projection shard passed 190 tests, and the turn lifecycle shard passed 229 tests with 3 skips. All current-sender and question-refresh cases passed.
  • Live Gateway proof, leases, local tests, local typechecks, and production-reverted negative controls were intentionally skipped per maintainer policy ("relax testing and trust PR CI, just lint"). No contributor runtime code was executed locally. Local test wall time was intentionally not measured. On the final head, the active-engine turn/start regression passed in 5.379 seconds (including cold fixture setup), and the continuity regression passed in 0.461 seconds. The history/no-history sender cases took 8/5 ms and the missing-ID case took 5 ms. The two Codex CI shards took 98.93/149.93 seconds including transformation and setup. These exercise full turn preparation and captured native input rather than only the formatter.

ClawSweeper's P2 native-mention finding and duplicate security/provenance concern are addressed by neutralizing only generated sender metadata. Its live-proof-only request (including the Telegram E2E label) is superseded by the maintainer policy above. The latest completed ClawSweeper review of the prior head confirms the prior native-mention finding is fixed and reports no actionable code findings; its remaining prior-head CI request is resolved by the final green run.

CI repair: the first run passed both turn/start regressions but found an excess-property error in the test metadata helper and a fake-clock publication timeout in the neighboring question-refresh fixture. The helper now infers its metadata shape without a cast; the fixture keeps its existing wait and timeout but flushes only zero-delay tasks, retaining its exactly-once, steering, answer, and persistence assertions. Both corrections passed lint/format and independent P0–P2 review before the final push, and both formerly failing jobs passed on the final head. No CI rerun or inherited-failure exception was used.

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 13, 2026
@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR places the admitted sender’s stable identity beside the current Codex request in both context-projection paths.

Example: Alice receives a roster reply, then Bea sends “i am Bea coded wdym”.

  • Before: The current request contains bare text, separated from Bea’s identity by replayed history.
  • After: The request is immediately preceded by [user sender={"id":"bea-id","name":"Bea","username":"bea"}].

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused repair is correct and final-head CI passed, but supplied proof does not meet the required shipped-behavior gate.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Codex can answer a new group participant as though the previous participant sent the request.
Reason: The reported behavior violates the existing sender-attribution contract, and the patch restores it within the current owner.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this PR open: it repairs a concrete attribution gap still present on current main, and no actionable code findings remain.

Priority: P2
Reviewed head: eefc97130d85609fde1356fe7d52107fb98056f7

Before merge

  • Add real behavior proof - The changed projection has passing CI and mocked native turn/start coverage, but no supplied after-fix shipped Gateway/Codex group-chat run; provide logs or terminal screenshots showing two speakers, adjacent current-sender attribution, and the resulting reply, redacting IPs, API keys, phone numbers, and non-public endpoints. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Findings

None.

Tests

  • Missing end-to-end proof: Missing an after-fix shipped Gateway/Codex two-speaker group turn showing adjacent attribution and the resulting reply; base-fail/head-pass negative controls were explicitly skipped.
Agent review details

How this fits together

The Codex plugin projects admitted user messages and conversation history into native turn/start text inputs, which Codex uses to produce the agent’s reply.

flowchart LR
A[Channel message] --> B[User turn admission]
B --> C[Codex prompt preparation]
D[Conversation history] --> E[Context projection]
C --> E
E --> F[Native turn start]
F --> G[Agent reply]
Loading

Technical review

Best possible solution:

Keep bounded, inert sender labels adjacent to current requests under the existing Codex projection owner.

Do we have a high-confidence way to reproduce the issue?

Current-main source deterministically emits the unlabeled request suffix reported on an official release; model misattribution was not independently exercised during this read-only review.

Is this the best way to solve the issue?

The repair targets the existing projection owner, reuses admitted metadata, preserves intentional request mentions, and adds no configuration or competing attribution path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 758febd268c8.

Provenance checked

  • Sender attribution keeps the original intent (d09b4bb: Preserve stable sender provenance through native compaction while leaving name-only records anonymous and generated metadata inert.)
  • Context-engine request projection keeps the original intent (51186d2: Project assembled context into Codex prompt text as part of the context-engine lifecycle.)
  • Question-refresh fixture keeps the original intent (cf9cbef: Preserve answered questions and accepted inputs during managed plugin-tool refresh.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source 0, Tests +119. Total +119 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 21 21 0
Tests 3 124 5 +119
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 145 26 +119

Review metrics

Metric Value Why it matters
Production versus test LOC Production +21/−21; tests +124/−5. Production remains flat; coverage protects anonymous attribution and the distinct active-engine and continuity preparation paths.

Root-cause cluster

Relationship: same_root_cause
Canonical: #170159
Summary: The linked issue owns current-request attribution; the earlier provenance repair addressed historical attribution.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A bounded Codex group-chat attribution defect can make replies address the previous participant.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. A Codex-backed Telegram group can observe the changed speaker attribution through consecutive requests from two users and the resulting reply.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Supply the two-speaker Gateway/Codex group-chat evidence described in realBehaviorProof.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-13T06:15:17.106Z sha d83f9c9 :: needs real behavior proof before merge. :: [P2] Neutralize native mentions in the current sender label
  • reviewed 2026-10-13T07:07:28.226Z sha f8a1ff4 :: needs real behavior proof before merge. :: none

Reviewed October 13, 2026, 3:35 AM ET / 07:35 UTC (Revision 3).

steipete and others added 4 commits October 12, 2026 23:47
Preserve stable sender attribution beside projected current requests while neutralizing native selection syntax only in generated labels. Cover both turn-start projection paths and remove redundant formatter scaffolding.

Co-authored-by: sunlit-deng <[email protected]>
@clawsweeper clawsweeper Bot added proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 13, 2026
@steipete
steipete merged commit 043ddbc into openclaw:main Oct 13, 2026
118 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
* fix(codex): label current group-chat request sender

* fix(codex): keep current sender metadata inert

Preserve stable sender attribution beside projected current requests while neutralizing native selection syntax only in generated labels. Cover both turn-start projection paths and remove redundant formatter scaffolding.

Co-authored-by: sunlit-deng <[email protected]>

* test(codex): infer sender fixture metadata without casts

* test(codex): preserve fake deadline during question delivery

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: sunlit-deng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex P2 Normal backlog priority with limited blast radius. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Codex harness group-chat "Current user request" has no sender label, so the model misattributes speakers

2 participants