Skip to content

fix(tui): correct Dynamic Workflow row rendering and progress - #24

Merged
elkaix merged 3 commits into
mainfrom
fix/dynamic-workflow-card-rendering
Aug 5, 2026
Merged

fix(tui): correct Dynamic Workflow row rendering and progress#24
elkaix merged 3 commits into
mainfrom
fix/dynamic-workflow-card-rendering

Conversation

@elkaix

@elkaix elkaix commented Aug 5, 2026

Copy link
Copy Markdown
Member

Related Issue

No issue filed — the problem is described below.

Problem

The Dynamic Workflow mission-control card renders raw model output without validating it, so a workflow called with object items ({prompt, description} instead of strings) produced a garbled card:

  • Rows 001–006 showed [object Object], because completed items were mapped through String.
  • Rows 007+ were phantoms: the streaming-arguments scanner treated every quoted string after "items": [ as an item, so object keys and nested values each became their own row (prompt, description, the values…). They were never removed once the real arguments arrived.
  • Streamed model text was concatenated onto the tool-activity label with no separator, producing lines like Using ReadI've read the first 5 files….

Separately, member progress crept toward a 99% ceiling on every streamed token. A subagent reached 99% within seconds and sat there for the rest of an 8-minute run, so the number carried no information.

What changed

  • Object items render a readable field (prompt / description / title / task) instead of [object Object].
  • The streaming scanner tracks brace/bracket depth, so only top-level array members count as items; a nested member occupies exactly one row.
  • Model text after a tool call starts a new line instead of fusing with the tool label.
  • Accepting the tool input drops surplus rows that streaming over-counted and that no agent claimed.
  • Member progress reflects the observed stage only (started / model text / tool call / terminal). The creep constants are removed; elapsed time and the latest line already carry liveness.

The tool call itself still fails validation for object items — that is the schema working as intended. This change only stops the card from displaying garbage while it happens.

Tests: two creep-specific tests were rewritten for stage-only progress, and three tests added for the tool-label separator, object item labels, and phantom-row pruning. test/tui passes (2340 tests).

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Summary by CodeRabbit

  • Bug Fixes

    • Dynamic Workflow cards now display object items with readable content instead of [object Object].
    • Removed phantom agent rows created during streaming.
    • Tool activity labels are separated from streamed text.
    • Workflow progress now remains accurate during active stages and no longer stalls at 99%.
  • Tests

    • Added coverage for workflow progress, row rendering, and tool/model output separation.

elkaix added 2 commits August 5, 2026 18:08
The mission-control card rendered raw model output without validating it.
When a workflow was called with object items, rows showed [object Object],
the streaming argument scanner counted object keys and nested values as
extra items, and streamed text was concatenated onto the tool-activity
label with no separator.

Member progress also crept toward 99% on every streamed token, so a
long-running subagent pinned at 99% within seconds and stayed there.
Progress now reflects the observed stage only; elapsed time and the latest
line carry liveness.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 50eb7c29-1c89-4345-b141-1c9a609e9a6e

📥 Commits

Reviewing files that changed from the base of the PR and between c99f73e and aced39a.

📒 Files selected for processing (1)
  • apps/pythinker-code/src/tui/components/messages/dynamic-workflow-mission-control.ts
📝 Walkthrough

Walkthrough

Dynamic Workflow rendering now keeps tool labels separate from model text, uses fixed stage-based progress, removes surplus streamed rows, and renders object items through readable fields without [object Object] output.

Changes

Dynamic workflow rendering

Layer / File(s) Summary
Progress and tool-state handling
apps/pythinker-code/src/tui/components/messages/dynamic-workflow-mission-control.ts, apps/pythinker-code/src/tui/constant/rendering.ts, apps/pythinker-code/test/tui/components/messages/dynamic-workflow-mission-control.test.ts, .changeset/dynamic-workflow-stage-progress.md
Tool labels use separate state from model text. Streamed progress stays at the observed model or tool stage until completion. Progress-creep settings and related expectations were removed.
Object items and speculative rows
apps/pythinker-code/src/tui/components/messages/dynamic-workflow-mission-control.ts, apps/pythinker-code/test/tui/components/messages/dynamic-workflow-mission-control.test.ts, .changeset/dynamic-workflow-garbled-rows.md
Object items use readable fields such as prompt. Nested values count as single top-level item slots. Unclaimed rows from partial arguments are removed after input completion. Tests verify row counts and output text.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title uses a valid conventional-commit prefix, stays within 72 characters, and uses imperative wording that describes the changes.
Description check ✅ Passed The description includes all required sections, explains the problem and changes, and confirms tests, changesets, documentation, and contribution requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Aug 5, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@pythoughts/pythinker-code@aced39a
npx https://pkg.pr.new/@pythoughts/pythinker-code@aced39a

commit: aced39a

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@apps/pythinker-code/src/tui/components/messages/dynamic-workflow-mission-control.ts`:
- Line 734: Update the regular expression in the arguments parsing logic to
include the Unicode flag, preserving its existing pattern and behavior so it
satisfies require-unicode-regexp.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7d525cda-00cc-4d1b-80de-f7ef3381f6cd

📥 Commits

Reviewing files that changed from the base of the PR and between 407878b and c99f73e.

📒 Files selected for processing (5)
  • .changeset/dynamic-workflow-garbled-rows.md
  • .changeset/dynamic-workflow-stage-progress.md
  • apps/pythinker-code/src/tui/components/messages/dynamic-workflow-mission-control.ts
  • apps/pythinker-code/src/tui/constant/rendering.ts
  • apps/pythinker-code/test/tui/components/messages/dynamic-workflow-mission-control.test.ts
💤 Files with no reviewable changes (1)
  • apps/pythinker-code/src/tui/constant/rendering.ts

@elkaix

elkaix commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

All CodeRabbit findings addressed in aced39a (the single require-unicode-regexp inline comment). Validated: component test suite (42 passed), oxlint on the touched file, and typecheck.

@elkaix
elkaix merged commit ae01098 into main Aug 5, 2026
11 checks passed
@elkaix
elkaix deleted the fix/dynamic-workflow-card-rendering branch August 5, 2026 22:28
elkaix added a commit that referenced this pull request Aug 5, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @pythoughts/pythinker-code@0.9.1

### Patch Changes

- [#24](#24)
[`ae01098`](ae01098)
- Fix the Dynamic Workflow card showing `[object Object]`, phantom extra
agent rows, and tool labels fused into streamed text when a workflow is
called with object items.

- [#24](#24)
[`ae01098`](ae01098)
- Show Dynamic Workflow member progress from the observed stage only, so
a running subagent no longer sits at 99% for the rest of its run.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: M Elkholy <melkholy@techmatrix.com>
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.

1 participant