Skip to content

fix: clear own display elements at agent startup - #4

Merged
sumitake merged 1 commit into
mainfrom
dev/claude/startup-clear
Aug 4, 2026
Merged

fix: clear own display elements at agent startup#4
sumitake merged 1 commit into
mainfrom
dev/claude/startup-clear

Conversation

@sumitake

@sumitake sumitake commented Aug 4, 2026

Copy link
Copy Markdown
Owner

After the v1.1 upgrade, the new agent's first draw got HTTP 400: the display still held the previous process's element with the same id but a different type, and the firmware rejects in-place type changes. Clearing the app's own elements once at startup makes agent upgrades collision-proof. (The element-timeout design already self-healed this in 90 s; this removes the window entirely.)

🤖 Generated with Claude Code

After the v1.1 upgrade, the first draw of the new agent got HTTP 400 because
the display still held the previous process's element with the same id but a
different element type; the firmware rejects in-place type changes. Clearing
the app's own elements at startup prevents any such collision after upgrades.

Applied to both integrations/calendar_countdown/main.py and
integrations/ci_status/main.py: add client.clear(APP) immediately after
BusyBarClient construction and before the poll loop.
@sumitake
sumitake force-pushed the dev/claude/startup-clear branch from 5177d71 to 9280161 Compare August 4, 2026 00:04
@sumitake
sumitake merged commit ba630fa into main Aug 4, 2026
2 checks passed
@sumitake
sumitake deleted the dev/claude/startup-clear branch August 4, 2026 00:05

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5177d71e18

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .venv Outdated
@@ -0,0 +1 @@
/Users/josumi/.venvs/busybar-integrations No newline at end of file

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 Remove the machine-specific .venv symlink

On every checkout where /Users/josumi/.venvs/busybar-integrations does not exist—including the Ubuntu test job in .github/workflows/ci.yml:13-16—this becomes a dangling .venv entry. The workflow's uv sync --group dev then exits with failed to create directory .../.venv: File exists, so CI and the documented uv run setup commands cannot run until the symlink is manually removed.

Useful? React with 👍 / 👎.


cfg = load_config()
client = BusyBarClient(host=cfg["device"]["host"])
client.clear(APP) # drop any stale elements from a previous process (type collisions 400)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Guard the startup clear in dry-run mode

When a user runs the documented --once --dry-run command against a reachable device, this unconditional call still sends a DELETE and removes the integration's currently displayed elements, contradicting the dry-run guarantee that the device is untouched. The equivalent startup clear in integrations/ci_status/main.py has the same problem, so both calls should be skipped when args.dry_run is set.

Useful? React with 👍 / 👎.

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