Skip to content

fix: reduce Feishu streaming card print_step to avoid duplicate rendering#33840

Open
aerelune wants to merge 1 commit intoopenclaw:mainfrom
aerelune:fix/issue-33751
Open

fix: reduce Feishu streaming card print_step to avoid duplicate rendering#33840
aerelune wants to merge 1 commit intoopenclaw:mainfrom
aerelune:fix/issue-33751

Conversation

@aerelune
Copy link
Copy Markdown
Contributor

@aerelune aerelune commented Mar 4, 2026

Summary

Adjust Feishu streaming card config to send one-character increments (print_step: 1) instead of two-character chunks. This avoids client-side visual duplication/appending artifacts observed during live card updates.

Testing

  • pnpm vitest extensions/feishu/src/streaming-card.test.ts

Fixes #33751

@openclaw-barnacle openclaw-barnacle bot added gateway Gateway runtime channel: feishu Channel integration: feishu size: XS labels Mar 4, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 4, 2026

Greptile Summary

This PR contains two independent but well-targeted fixes: (1) reduces the Feishu streaming card print_step from 2 to 1 to eliminate client-side visual duplication during live card updates, and (2) updates readSystemctlDetail in the systemd helper to combine both stderr and stdout (rather than silently preferring stderr), fixing an edge case where systemctl is-enabled reports a unit state via stdout while stderr holds a generic error string, which previously caused isSystemdServiceEnabled to throw instead of returning false.

  • extensions/feishu/src/streaming-card.ts: print_step.default lowered from 21; no other changes.
  • src/daemon/systemd.ts: readSystemctlDetail now joins stderr and stdout with "\n" so downstream keyword checks (not-found, disabled, etc.) are applied against the full combined output.
  • src/daemon/systemd.test.ts: Adds a regression test validating the stdout-carries-state / stderr-carries-generic-error scenario.

Confidence Score: 5/5

  • This PR is safe to merge — both changes are minimal, well-understood, and covered by tests.
  • The Feishu change is a single integer value tweak in a config struct with no side-effects beyond reduced render step size. The systemd change is a small, well-tested utility function fix whose impact is limited to combining two output streams before keyword matching; the new test directly exercises the previously-broken code path, and existing tests continue to pass. No new dependencies, no API surface changes, no error-handling regressions.
  • No files require special attention.

Last reviewed commit: ce4a6cc

t2wei pushed a commit to t2wei/openclaw that referenced this pull request Mar 5, 2026
…ge spam

- Block narration: replace card content instead of append (users see latest status)
- Final payloads: replace card content, let onIdle close (prevents multiple cards)
- onPartialReply: replace streamText directly to avoid append duplication (openclaw#34108, openclaw#33751)
- Reduce print_step to 1 to minimize client-side visual duplication (openclaw#33840)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
t2wei pushed a commit to t2wei/openclaw that referenced this pull request Mar 5, 2026
…ge spam

- Block narration: replace card content instead of append (users see latest status)
- Final payloads: replace card content, let onIdle close (prevents multiple cards)
- onPartialReply: replace streamText directly to avoid append duplication (openclaw#34108, openclaw#33751)
- Reduce print_step to 1 to minimize client-side visual duplication (openclaw#33840)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@openclaw-barnacle openclaw-barnacle bot added size: L and removed channel: feishu Channel integration: feishu size: XS labels Mar 13, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aafb7900ac

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

vi.mock("node:child_process", () => ({
execFile: execFileMock,
}));
import { createExecFileError, mockExecFileUtf8, resetMockExecFileUtf8 } from "../test-utils/exec-file.js";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use a resolvable helper import in systemd test

src/daemon/systemd.test.ts now imports ../test-utils/exec-file.js, but there is no src/test-utils/exec-file.* module in the repo. In this state Vitest fails during module resolution before any assertions run, so the daemon systemd test file cannot execute at all in CI or local runs.

Useful? React with 👍 / 👎.

import { beforeEach, describe, expect, it, vi } from "vitest";

const execFileMock = vi.hoisted(() => vi.fn());
import { describe, expect, it, vi } from "vitest";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Import beforeEach from vitest in rewritten suite

This file calls beforeEach(...) but no longer imports it from vitest. Since vitest.config.ts does not enable global test APIs, evaluating this suite throws ReferenceError: beforeEach is not defined, so the test file still fails even after fixing the helper import.

Useful? React with 👍 / 👎.

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

Labels

gateway Gateway runtime size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Feishu streaming card content shows duplicate/appending text during streaming

2 participants