Skip to content

fix: Codex turns stop showing typing during tool work#95844

Merged
jalehman merged 2 commits into
mainfrom
fix/codex-harness-typing-bridge
Jun 24, 2026
Merged

fix: Codex turns stop showing typing during tool work#95844
jalehman merged 2 commits into
mainfrom
fix/codex-harness-typing-bridge

Conversation

@jalehman

@jalehman jalehman commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users running turns through the Codex harness could see the channel typing indicator stop during long-running model, tool, or command work, even though the same conversation surface stayed visibly active under the embedded OpenClaw harness.

Why This Change Was Made

The fix bridges user-visible harness execution phases into the existing reply typing signaler instead of adding Telegram-specific behavior. Codex CLI/app-server phases and embedded runner phases now share the same channel-neutral activity hook, so transports that already support typing/progress cues can refresh them before assistant text arrives.

This also includes a narrow Kysely guardrail allowlist update for the existing sqlite-user-version.ts PRAGMA helper. Current CI's architecture shard requires that direct raw SQLite metadata probe to be explicitly classified as schema/pragma access.

User Impact

Users can expect Codex-backed turns to show the same “agent is still working” signal as embedded turns during long tool-heavy work, long single commands, errors with recovery, and queued follow-up turns. This reduces the silent gap where a turn looked idle until the final reply appeared.

This changes typing start/refresh timing, not reply content or delivery. Because the bridge uses the shared typing signaler, execution activity can now start or refresh typing before the first assistant text delta in modes that previously waited for text/reasoning-only signals, including default group message mode. typingMode: "never" and heartbeat/system-event suppression remain unchanged.

Evidence

  • Behavior addressed: Codex harness turns were doing active model/tool/command work while the channel typing/progress signal expired before assistant text arrived.
  • Real environment tested: Phaedrus maintainer OpenClaw gateway running from source with the Codex harness active, rebuilt dist, and a live Telegram group thread watched by Josh. The rebuilt runtime was verified to contain both signalExecutionActivity and signalExecutionPhaseForTyping.
  • Exact steps or command run after this patch:
    1. Loaded the patch onto the maintainer gateway runtime source, rebuilt dist, and restarted the gateway.
    2. Ran a Codex harness test burst with multiple read-only tool calls and two slow sleeps while the turn stayed open.
    3. Re-ran focused live checks: tool-heavy burst, one single command of about 25 seconds, failed command plus recovery, and a queued follow-up message while the first turn was active.
    4. Ran node scripts/run-vitest.mjs run src/auto-reply/reply/reply-utils.test.ts src/auto-reply/reply/agent-runner-execution.test.ts.
    5. Ran OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 node scripts/check-changed.mjs.
    6. Ran AUTOREVIEW_ENGINE=codex PATH="/var/lib/openclaw/.local/bin:$PATH" .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --stream-engine-output.
    7. Ran node scripts/check-kysely-guardrails.mjs after the guardrail allowlist update.
  • Evidence after fix:
    • Josh observed continuous Telegram typing during active Codex harness tool phases.
    • Focused Vitest passed: 2 files, 284 tests.
    • Changed-scope gate passed.
    • Fresh Codex autoreview reported no accepted/actionable findings; overall patch is correct, confidence 0.82.
    • node scripts/check-kysely-guardrails.mjs passed with Kysely guardrails OK.
  • Observed result after fix:
    • Typing stayed visible during Codex harness execution before assistant text across tool-heavy, long-command, failed-tool recovery, and queued-turn paths.
    • For the queued follow-up case, typing stopped after the first response was delivered and started again when the queued turn began processing, matching the expected active-turn boundary.
  • What was not tested:
    • The gateway logs did not emit a clean per-sendChatAction(typing) line, so the transport-level proof is visual plus runtime/source verification rather than a machine-verifiable chat-action log.
    • Non-Telegram transports were not live-tested; the implementation is covered through the channel-neutral typing signaler path.
  • Dependency contract check:
    • Inspected sibling Codex app-server protocol source for the activity surfaces this bridge consumes: ../codex/codex-rs/app-server-protocol/src/protocol/v2/item.rs:215, ../codex/codex-rs/app-server-protocol/src/protocol/v2/item.rs:1127, and ../codex/codex-rs/app-server-protocol/src/protocol/thread_history.rs:652.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jun 22, 2026
@jalehman
jalehman force-pushed the fix/codex-harness-typing-bridge branch from 84adf85 to 7cf8d07 Compare June 22, 2026 20:12
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Jun 22, 2026
@jalehman jalehman self-assigned this Jun 22, 2026
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Jun 23, 2026
@clawsweeper

clawsweeper Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 2:45 PM ET / 18:45 UTC.

Summary
Adds a channel-neutral execution-activity typing signal, wires CLI and embedded harness execution phases into it, and updates typing tests/docs.

PR surface: Source +34, Tests +108, Docs +1. Total +143 across 5 files.

Reproducibility: yes. Current main has no execution-activity typing signal and message-mode tool-start typing waits for renderable text, so long pre-text Codex work can leave typing idle from source inspection.

Review metrics: 1 noteworthy metric.

  • Default typing timing: 1 trigger broadened. Execution activity can now start or refresh typing for message/thinking modes before assistant text, so maintainers should notice the visible behavior change before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Refresh the PR body so it no longer claims a Kysely guardrail update in the current diff.
  • Get maintainer acceptance for treating execution activity as a default typing trigger.

Mantis proof suggestion
Native Telegram Desktop proof would directly show the visible typing timing change and active-turn boundary. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify Codex harness turns keep Telegram typing visible during long tool or command work, then stop at the active-turn boundary.

Risk before merge

  • [P1] The PR intentionally broadens default visible typing timing: existing message/thinking-mode sessions can now show or refresh typing on harness execution before assistant text.
  • [P1] The PR body still claims a Kysely guardrail allowlist update, but the current diff touches only typing runtime, tests, and docs, so release-review context should be refreshed before landing.

Maintainer options:

  1. Accept execution activity typing (recommended)
    Maintainers can accept that admitted harness execution counts as user-visible activity and may start or refresh typing before assistant text.
  2. Constrain earlier typing
    If earlier default group typing is too noisy, revise the bridge to refresh only already-active typing or gate execution activity behind an explicit mode.

Next step before merge

  • [P2] Manual review is needed for the protected maintainer label and compatibility-sensitive visible typing timing; no narrow automated repair is indicated.

Security
Cleared: No concrete security or supply-chain issue was found in the current runtime, test, and docs diff.

Review details

Best possible solution:

Land the channel-neutral execution-phase typing bridge once maintainers accept execution activity as a default typing trigger and the stale PR-body Kysely note is removed.

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

Yes. Current main has no execution-activity typing signal and message-mode tool-start typing waits for renderable text, so long pre-text Codex work can leave typing idle from source inspection.

Is this the best way to solve the issue?

Mostly yes. The fix is in the channel-neutral typing layer and reuses existing execution-phase contracts; the remaining question is whether maintainers accept the broader default timing for existing sessions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4c841ac575d7.

Label changes

Label justifications:

  • P2: This is a focused user-visible typing bug fix with limited blast radius.
  • merge-risk: 🚨 compatibility: Existing message/thinking-mode sessions can begin or refresh typing earlier than before this PR.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body reports after-fix live Telegram gateway proof across tool-heavy, long-command, recovery, and queued-turn Codex harness paths, with focused tests and changed-scope checks as support.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports after-fix live Telegram gateway proof across tool-heavy, long-command, recovery, and queued-turn Codex harness paths, with focused tests and changed-scope checks as support.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes visible Telegram typing behavior during Codex harness work, which a short Telegram Desktop recording can demonstrate directly.
Evidence reviewed

PR surface:

Source +34, Tests +108, Docs +1. Total +143 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 34 0 +34
Tests 2 109 1 +108
Docs 1 12 11 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 155 12 +143

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored the typing mode controls, centralized typing signals, mode-safe tool-start behavior, lifecycle hardening, and structured execution item event work that this PR extends. (role: typing surface feature owner by history; confidence: high; commits: bac160893317, 434c25331eaa, 6a81652ebfa3; files: src/auto-reply/reply/typing-mode.ts, src/auto-reply/reply/agent-runner-execution.ts, src/agents/embedded-agent-runner/execution-phase.ts)
  • Sash Catanzarite: Sash authored the tool-start typing trigger that this PR effectively generalizes for execution activity before assistant text. (role: introduced adjacent behavior; confidence: medium; commits: 29c5ed54b276; files: src/auto-reply/reply/typing-mode.ts)
  • thewilloftheshadow: Shadow authored prior work to keep typing indicators active during tool runs on the same typing behavior surface. (role: adjacent typing behavior contributor; confidence: medium; commits: da95b58a2a27; files: src/auto-reply/reply/typing-mode.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 23, 2026
@jalehman
jalehman force-pushed the fix/codex-harness-typing-bridge branch from eb2155b to 2b1ac20 Compare June 24, 2026 17:53
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts and removed scripts Repository scripts labels Jun 24, 2026
@jalehman
jalehman force-pushed the fix/codex-harness-typing-bridge branch from 03836c5 to cfdd436 Compare June 24, 2026 18:29
@openclaw-barnacle openclaw-barnacle Bot removed the scripts Repository scripts label Jun 24, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 24, 2026
@jalehman
jalehman force-pushed the fix/codex-harness-typing-bridge branch from cfdd436 to 17ee63c Compare June 24, 2026 18:39
@jalehman
jalehman merged commit b6bc3ed into main Jun 24, 2026
96 checks passed
@jalehman
jalehman deleted the fix/codex-harness-typing-bridge branch June 24, 2026 18:50
@jalehman

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 25, 2026
* fix: bridge harness execution phases to typing

* docs: clarify typing indicator activity triggers
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
* fix: bridge harness execution phases to typing

* docs: clarify typing indicator activity triggers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant