Skip to content

Add TTY check and debounce behavior; update README and tests#1

Merged
Astro-Han merged 1 commit intomainfrom
codex/analyze-entire-project
Mar 13, 2026
Merged

Add TTY check and debounce behavior; update README and tests#1
Astro-Han merged 1 commit intomainfrom
codex/analyze-entire-project

Conversation

@Astro-Han
Copy link
Owner

Motivation

  • Make the bell plugin quieter and safer by only ringing in interactive terminals and preventing rapid duplicate rings.
  • Document the new runtime behavior and publish a patch version bump to 0.1.1.
  • Add unit tests to validate TTY checking, debounce timing, and per-session keys.

Description

  • Bumped README install example to opencode-bell@0.1.1 and added a "Behavior details" section documenting that the plugin only rings when process.stdout.isTTY is true, debounces repeated rings within 1200ms, and uses session-specific keys when event.properties.sessionID is present.
  • Added test helpers withStdoutStub and withMockedNow and expanded test/plugin.test.js with tests that assert ringing for supported events, silence for unsupported events, TTY gating, debounce behavior across timestamps, and session-specific debounce keys.
  • Ensured the plugin still tolerates missing event.properties by keeping the existing test that verifies no rejection when properties is absent.

Testing

  • Ran the unit test suite (node:test via the repository npm test command) which executed the updated test/plugin.test.js tests.
  • The new tests for TTY gating, event support, debounce timing, and session-specific keys passed successfully.
  • The existing regression test that ensures no throw on missing event.properties also passed.

Codex Task

@Astro-Han Astro-Han merged commit b972301 into main Mar 13, 2026
2 checks passed
@Astro-Han Astro-Han deleted the codex/analyze-entire-project branch March 18, 2026 06:32
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.

1 participant