Skip to content

feat: OpenCode Logging - #3

Merged
renjfk merged 5 commits into
renjfk:mainfrom
tolly-xyz:feature/logging
Jun 13, 2026
Merged

feat: OpenCode Logging#3
renjfk merged 5 commits into
renjfk:mainfrom
tolly-xyz:feature/logging

Conversation

@tolly-xyz

Copy link
Copy Markdown
Contributor

Summary

  • Add structured OpenCode plugin diagnostics via client.app.log()
  • Log notable lifecycle events across STT, TTS, prompt loading, and LLM normalization
  • Document how to use opencode’s own logs and --log-level for troubleshooting

Details

This change introduces a small shared logger wrapper around client.app.log() and threads it through the voice plugin so failures and state transitions are visible in OpenCode’s normal logs.
Logged areas include:

  • Plugin initialization
  • Custom prompt loading failures
  • LLM normalization requests, responses, retries, and empty content cases
  • STT recording, local whisper-cli execution, and STT API requests
  • TTS normalization, Piper invocation, and SoX playback failures

Validation

  • npm test
  • npm run check

Notes

  • Routine events log at debug
  • Recoverable problems log at warn
  • Failed child processes, API calls, and unexpected exceptions log at error

@tolly-xyz

Copy link
Copy Markdown
Contributor Author

For context: I had some issues getting things set up for this plugin. Granted, I was not following the docs 1:1 (installed cli tools via nix-darwin), but having a view into the plugin's internal state would have made debugging things a lot easier. I did end up getting the plugin working, and I've really enjoyed using it!

Comment thread lib/tts.js Outdated
@renjfk

renjfk commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Hey, thanks for the contribution! I'm glad that it's been useful to folks other than me (:

There's one alarming conditional logic other than that it's fine.

Co-authored-by: Soner Köksal <15015690+renjfk@users.noreply.github.com>
@tolly-xyz

Copy link
Copy Markdown
Contributor Author

Suggestion applied!

@renjfk
renjfk merged commit 2b1e9fa into renjfk:main Jun 13, 2026
3 checks passed
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.

2 participants