Skip to content

AI Fix for Issue #169: Bug: Live Event Stream 'Currently' shows To-Do instead of last Thought - #178

Merged
integry merged 1 commit into
mainfrom
ai-fix/169-bug-live-event-stream-cur-20251027-1413-claude-sonnet-4-5-20250929-58z
Oct 27, 2025
Merged

integry merged 1 commit into
mainfrom
ai-fix/169-bug-live-event-stream-cur-20251027-1413-claude-sonnet-4-5-20250929-58z

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #169

Model Used: claude-sonnet-4-5-20250929
Status: ✅ Implementation Completed
Branch: ai-fix/169-bug-live-event-stream-cur-20251027-1413-claude-sonnet-4-5-20250929-58z
Commits: ✅ Changes committed (a6b3314)


🤖 AI Processing Completed

Execution Details:

Summary:
Perfect! I've successfully implemented the fix for issue #169. Here's what was changed in gitfix-ui/src/components/TaskDetails.tsx:

Summary

Fixed the Live Event Stream header to display the last thought instead of the current to-do item.

Changes Made:

  1. Added state variable (line 23): Added lastThought state to track the most recent thought event

  2. Added useEffect hook (lines 97-104): Implemented logic to find and set the last thought event whenever liveDetails updates

  3. Updated JSX (lines 407-411): Modified the collapsed header to display lastThought instead of liveDetails.currentTask, with:

    • Label changed from "Currently:" to "Thinking:"
    • Content truncated to 100 characters with ellipsis if longer
    • Only displays when there's a thought available

The implementation follows the existing code patterns and uses the same approach as other useEffect hooks in the component.

Claude Code Results:

  • Turns Used: 21
  • Cost: $0.46
  • Session ID: faae9a4a-5922-445a-9b33-7f6779051bce

📁 Detailed Logs:
Execution logs generated:

  • Conversation: 21 messages
  • Session: faae9a4a-5922-445a-9b33-7f6779051bce
  • Raw Output: 73,410 characters

Log files stored at:

  • conversation: /tmp/claude-logs/issue-169-2025-10-27T14-14-34-392Z-conversation.json
  • output: /tmp/claude-logs/issue-169-2025-10-27T14-14-34-392Z-output.txt
💬 Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: Perfect! I've successfully implemented the fix for issue #169. Here's what was changed in `gitfix-ui/src/components/TaskDetails.tsx`:

## Summary

**Fixed the Live Event Stream header to display the l...


Powered by Claude Code v1.0.0


This PR was created automatically by Claude Code after processing issue #169.

…s To-Do ins

Implemented by Claude Code using claude-sonnet-4-5-20250929 model.

Implementation completed successfully.
@propr-dev propr-dev Bot added the gitfix label Oct 27, 2025
@integry
integry merged commit bac5b35 into main Oct 27, 2025
@integry
integry deleted the ai-fix/169-bug-live-event-stream-cur-20251027-1413-claude-sonnet-4-5-20250929-58z branch October 27, 2025 14:25
propr-dev Bot pushed a commit that referenced this pull request Nov 18, 2026
…outside follow-ups (ProPR Hosted repin, site, demo) to the run summary. If the token is set it opens them as issues; if not, the job still succeeds and prints the exact text to file by hand. The new and affected test files pass locally (189 tests). Nothing has run in GitHub Actions yet, so the real issue creation and the SSH deploy are untested against the live repositories.

The follow-ups (texts built by a new script, `scripts/release-followups.mjs`):
- `integry/propr-fleet` — "Repin ProPR Hosted to ProPR `<version>`": the run id, artifact name and id, tarball name and sha256, CLI version, tag commit and the three image references (the facts #178 listed), plus the repin steps. It is only written if the preview CLI bundle succeeded.
- `integry/propr-site`: the release's `published_at` line for `follow.ts` and the two `desktopRelease(...)` lines with the desktop pre-release tags for `releases.ts`. It waits until the GitHub release and both desktop pre-releases are published.
- `integry/propr-deploy` — "Move demo.propr.dev to ProPR `<version>`": names the `DEMO_API_IMAGE` / `DEMO_UI_IMAGE` pins in `deploy.env`. It is skipped when `demo.propr.dev/api/status` already reports the release.

A follow-up that isn't ready says why in the summary.

How the job files them:
- Token: the optional secret is `RELEASE_FOLLOWUP_ISSUES_TOKEN`, which needs only Issues read/write on those three repositories. With it, the workflow calls `gh issue create` and skips any issue whose exact title already exists (open or closed), so re-runs don't file duplicates.
- Demo deploy: if all three of `DEPLOY_HOST`, `DEPLOY_USER` and `DEPLOY_SSH_KEY` are set, the job runs the documented `./scripts/deploy.sh all` over SSH. The demo issue is then only written if the demo still doesn't report the release. A failed deploy is a warning, not a failed run.

Before relying on these, check three things:
- Demo pins: `deploy.sh all` doesn't change the pins in `deploy.env`. That's why the job re-checks the demo afterwards rather than assuming the deploy worked.
- Where the SSH runs: I used a GitHub-hosted runner with plain `ssh`. The snippet in `propr-deploy` runs on the self-hosted runner, so the server must accept SSH from GitHub-hosted runners.
- Host key: SSH accepts the server's host key on first contact without checking it.

Supporting changes:
- Preview CLI Bundle workflow now outputs `cli_version`, `artifact_name`, `artifact_id`, `tarball` and `tarball_sha256`.
- Rollout plan now outputs `desktop_version`, `linux_release_tag` and `macos_release_tag`.
- Docs: `.github/CONTRIBUTING.md` lists the full release flow in order: metadata PR, tag, automatic publication, `release-rollout.yml` and its approvals, follow-up issues, then `npm run release:rollout`. It also documents the follow-ups, the token and the deploy secrets. `CHANGELOG.md` and `packages/cli/scripts/preview-package.md` are updated too.
- Tests: new `test/releaseFollowups.test.mjs` covers the text generation and the job contract. That includes running the job's shell steps without secrets, and with a fake `gh` to check that duplicates are skipped. It's added to `test:unit`, and the existing rollout and CLI workflow tests are updated for the new job and outputs.

I didn't create visual previews, since nothing here changes a screen.
integry pushed a commit that referenced this pull request Nov 18, 2026
…e links as tracked follow-up steps (#3724)

* Release Rollout now ends with a follow-ups job that writes the three outside follow-ups (ProPR Hosted repin, site, demo) to the run summary. If the token is set it opens them as issues; if not, the job still succeeds and prints the exact text to file by hand. The new and affected test files pass locally (189 tests). Nothing has run in GitHub Actions yet, so the real issue creation and the SSH deploy are untested against the live repositories.

The follow-ups (texts built by a new script, `scripts/release-followups.mjs`):
- `integry/propr-fleet` — "Repin ProPR Hosted to ProPR `<version>`": the run id, artifact name and id, tarball name and sha256, CLI version, tag commit and the three image references (the facts #178 listed), plus the repin steps. It is only written if the preview CLI bundle succeeded.
- `integry/propr-site`: the release's `published_at` line for `follow.ts` and the two `desktopRelease(...)` lines with the desktop pre-release tags for `releases.ts`. It waits until the GitHub release and both desktop pre-releases are published.
- `integry/propr-deploy` — "Move demo.propr.dev to ProPR `<version>`": names the `DEMO_API_IMAGE` / `DEMO_UI_IMAGE` pins in `deploy.env`. It is skipped when `demo.propr.dev/api/status` already reports the release.

A follow-up that isn't ready says why in the summary.

How the job files them:
- Token: the optional secret is `RELEASE_FOLLOWUP_ISSUES_TOKEN`, which needs only Issues read/write on those three repositories. With it, the workflow calls `gh issue create` and skips any issue whose exact title already exists (open or closed), so re-runs don't file duplicates.
- Demo deploy: if all three of `DEPLOY_HOST`, `DEPLOY_USER` and `DEPLOY_SSH_KEY` are set, the job runs the documented `./scripts/deploy.sh all` over SSH. The demo issue is then only written if the demo still doesn't report the release. A failed deploy is a warning, not a failed run.

Before relying on these, check three things:
- Demo pins: `deploy.sh all` doesn't change the pins in `deploy.env`. That's why the job re-checks the demo afterwards rather than assuming the deploy worked.
- Where the SSH runs: I used a GitHub-hosted runner with plain `ssh`. The snippet in `propr-deploy` runs on the self-hosted runner, so the server must accept SSH from GitHub-hosted runners.
- Host key: SSH accepts the server's host key on first contact without checking it.

Supporting changes:
- Preview CLI Bundle workflow now outputs `cli_version`, `artifact_name`, `artifact_id`, `tarball` and `tarball_sha256`.
- Rollout plan now outputs `desktop_version`, `linux_release_tag` and `macos_release_tag`.
- Docs: `.github/CONTRIBUTING.md` lists the full release flow in order: metadata PR, tag, automatic publication, `release-rollout.yml` and its approvals, follow-up issues, then `npm run release:rollout`. It also documents the follow-ups, the token and the deploy secrets. `CHANGELOG.md` and `packages/cli/scripts/preview-package.md` are updated too.
- Tests: new `test/releaseFollowups.test.mjs` covers the text generation and the job contract. That includes running the job's shell steps without secrets, and with a fake `gh` to check that duplicates are skipped. It's added to `test:unit`, and the existing rollout and CLI workflow tests are updated for the new job and outputs.

I didn't create visual previews, since nothing here changes a screen.

* feat(ai): I fixed F1. If the GitHub release lookup fails, the run now still writes the fleet and demo follow-ups, `issues.tsv` and the summary, and only the site follow-up is held back.

I fixed F1. If the GitHub release lookup fails, the run now still writes the fleet and demo follow-ups, `issues.tsv` and the summary, and only the site follow-up is held back.

**The fix** (`scripts/release-followups.mjs`):
- **`releasePublishedAt` no longer throws.** It now returns either `{ publishedAt }` or `{ unavailable: <reason> }`. A dropped connection or a response body that isn't JSON becomes a reason such as `GET https://api.github.com/... failed: fetch failed (ECONNRESET)`. An HTTP error, a draft release, or a missing `published_at` also come back with a reason.
- **`prepare` passes that reason through.** The site follow-up is then "not ready", and the summary says why, for example `the GitHub release v0.9.3 has no published_at (GET … failed: …)`. Because nothing rejects any more, the shared wait on the two lookups can't stop the other outputs from being written.

The demo lookup already had this protection through `checkStatusJson`, and I confirmed it covers both failed requests and non-JSON responses. The GitHub release lookup was the only place with the problem.

**Tests** (`test/releaseFollowups.test.mjs`):
- I updated the existing `releasePublishedAt` assertions to the new return shape.
- I added unit tests for a dropped connection and for a body that isn't JSON.
- I added a `prepare` test for each of those two failures. Each checks that `fleet.md` and `demo.md` are written, `site.md` is not, `issues.tsv` lists only the fleet and deploy repositories, and the summary gives the reason and the file-by-hand texts when no token is set.
- I added a check that the site reason includes the diagnostic.

All 19 tests in this file pass, along with the 36 in the rollout and CLI workflow test files, and eslint reports nothing. Against the previous version of the script, the new and changed tests fail (5 failures), so they do catch the original bug.

**Separate issue, not fixed (outside F1):** the GitHub release request has no timeout, while the shared `get` helper used for the demo lookup gives up after 20 seconds. If the request hangs, the step still waits until the job itself times out. I left this alone because F1 only covers failed requests and unparsable responses.

PR: #3724
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5

* feat(ai): The SSH demo step in the `followups` job now starts the deploy detached on the host and returns straight away, so the job's 30-minute timeout can no longer cut off a refresh. The two test files pass locally (42 tests), lint is clean and the step's shell passes a syntax check. I haven't tested the real SSH and `systemd-run` call against the host, and actionlint isn't installed here, so CI will be the first lint of the workflow.

The SSH demo step in the `followups` job now starts the deploy detached on the host and returns straight away, so the job's 30-minute timeout can no longer cut off a refresh. The two test files pass locally (42 tests), lint is clean and the step's shell passes a syntax check. I haven't tested the real SSH and `systemd-run` call against the host, and actionlint isn't installed here, so CI will be the first lint of the workflow.

**1. Detached start** (`.github/workflows/release-rollout.yml`)
- The step is renamed "Start the demo deploy over SSH…" and over SSH it runs:
  `mkdir -p /root/propr-deploy/logs && systemd-run --unit=propr-release-deploy-<version> --collect --setenv=HOME=/root --working-directory=/root/propr-deploy --property=StandardOutput=append:<log> --property=StandardError=append:<log> /root/propr-deploy/scripts/deploy.sh all`
- The log is `/root/propr-deploy/logs/release-deploy-<version>.log`.
- `systemd-run` returns once the unit has started, and the unit keeps running after the session ends. Starting the same version again fails while a deploy is still running, so a re-run can't start a second refresh on top of it.
- I set `HOME=/root` because a systemd unit doesn't get a login shell's environment. If `deploy.sh` needs other variables from a login shell, the unit won't have them.
- On success the step outputs `result=started` and adds a "Demo deploy" section to the run summary with the unit name, the log path and the `systemctl status` / `tail -f` commands to check it.
- If the start fails, that is a warning and the step outputs `result=failure`; the run doesn't fail.
- The plan's version is checked as `X.Y.Z` before it goes into the remote command.
- The workflow header comment is updated to match.

**2. Demo follow-up** (`scripts/release-followups.mjs`)
- "Started" no longer counts as done. The issue is skipped only when demo.propr.dev already reports the release.
- Since the check runs right after the start, the issue will almost always be opened when the secrets are set.
- When the deploy was started, the issue says the run started it and didn't wait. It gives the unit and log, the `systemctl status` / `tail -n 50` checks, and says to close the issue if the demo reports the version, or to follow the manual steps once the deploy has stopped. The "To make this automatic" paragraph is left out in that case.

**3. SSH keepalive:** the ssh call now has `-o ServerAliveInterval=30 -o ServerAliveCountMax=4`.

**4. Tests**
- `test/releaseFollowups.test.mjs` runs the step with a fake `ssh`. It checks the options, the exact remote command, `result=started`, the summary text and that the key file is removed. It also covers a failed start, a malformed version, and the new issue wording, including that only the demo reporting the release makes the issue unnecessary.
- `test/releaseRolloutWorkflow.test.mjs` checks that the job only starts the deploy detached (no foreground `deploy.sh all`, no `--wait` or `--pty`), the keepalive options and the header comment.

**Decision for you:** line 136 of `.github/CONTRIBUTING.md` still says the job "runs the documented SSH deploy (`cd /root/propr-deploy && ./scripts/deploy.sh all`)", which is now out of date. I left it alone because you said nothing else should change. Updating it is a one-sentence edit if you want it.

PR: #3724
Comment by: @integry (ID: 6992893101)
Model: Claude Opus 5.5

---------

Co-authored-by: propr-dev[bot] <1316198+propr-dev[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Live Event Stream 'Currently' shows To-Do instead of last Thought

2 participants