feat(opencode): Message logger#32381
Open
bornmw wants to merge 3 commits into
Open
Conversation
Replace experimental.log_messages boolean with a string union
('info' | 'debug' | 'trace') that controls verbosity:
- 'info': messages + response text (logInfo)
- 'debug': adds generation params (logDebug)
- 'trace': adds raw provider-native request body (logDebug)
The experimental.log_messages config was only wired into the native LLM runtime path. The default AI SDK runtime had no logging support, so the setting appeared broken for most users. - Log request (model, messages, generation params) before streamText - Log response events via Stream.tap in the LLMEvent pipeline - Reuse MessageLogger.formatEvents for response formatting
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #29186
Type of change
What does this PR do?
Adds configurable LLM request/response logging via
experimental.log_messages("info","debug","trace") and wires it into both the native and AI SDK runtimes."info"— logs messages + response text (Effect.logInfo)"debug"— adds generation params (Effect.logDebug)"trace"— adds raw provider-native request body (native runtime only, Effect.logDebug)Also fixes a crash on
--continuewhere a"dummy"session ID placeholder triggered a server-side validation error — the fake route was removed and the App component's existing--continueeffecthandles navigation once sync loads.
How did you verify your code works?
OPENCODE_LOG_LEVEL=DEBUG—LLM requestandLLM responseentries appear in the log file at all three verbosity levels--continueno longer shows the"ses"validation errorChecklist
If you do not follow this template your PR will be automatically rejected.