report: attach the log lines the caller read - #74
Open
rafaelfiguereod-stack wants to merge 1 commit into
Open
rafaelfiguereod-stack wants to merge 1 commit into
rafaelfiguereod-stack wants to merge 1 commit into
Conversation
The tool description asks the caller to check the attached logs for anything private, but the caller could not: it passed a count, and the handler resolved that count against the live buffer itself, so the lines published were ones nothing upstream had seen. Reading them first with the logs tool did not close it either, because the tail was taken again inside report and the app keeps logging in between. logs is now the lines to attach rather than how many to take. What the caller read is what gets filed, and the instruction in the description is one it can follow. dapi report --logs <n> keeps working: the command makes the logs call itself and passes what comes back, so `dapi logs --tail n` shows exactly what an issue would carry. formatLogEntry moves into the dapi package, beside the logs tool and LogEntry, so both sides produce the same line. Refs diffusionstudio#73 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@rafaelfiguereod-stack is attempting to deploy a commit to the Diffusion Studio Team on Vercel. A member of the Team first needs to authorize it. |
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.
Fixes #73.
The change
report'slogsfield becomes the lines to attach rather than a count of lines for the app to go and fetch:and the handler files what it was handed instead of re-reading the buffer:
That makes the existing instruction in the description followable. Reading the logs first was already possible through the
logstool, but it did not guarantee much, because the tail was taken again insidereportand the app keeps logging in between. Now there is only one read, and the caller did it.I reworded the description to match, keeping the no review step sentence as you had it.
dapi report --logs n still works the same
The command makes the
logscall itself and passes what comes back, so nothing changes for someone at a terminal. It also meansdapi logs --tail nnow shows exactly what an issue would carry, since it is the same call and the same formatting.To get that,
formatLogEntrymoves fromapps/desktop/src/dapi/handlers/logs.tsintopackages/dapi/src/tools/logs.ts, beside thelogstool and theLogEntryschema it formats. Both the app and the CLI import it from there, so a line cannot drift between the two.ISSUE_LOG_TAILstays at 50 and is now the CLI's default rather than the handler's.Verified
Windows 11, Node 24.1.0, Electron 43, on top of b317412.
npm run checkfordapi,desktopandcli: cleannpm test --workspace=@diffusionstudio/dapi: 37 passed, up from 36, the new one covers the schema changenpm run lint: unchanged, 0 errors and the same 3 pre-existing warningsghtaken off the app'sPATHso nothing could actually be filed:dapi report "..." --logs 2made thelogscall, passed the formatted lines, the handler accepted them and reached theghstep, which failed with the expected "gh is not installed" message. The lines matcheddapi logs --tail 2exactly.I did not drive a real filing, for the obvious reason.
Unrelated, but noticed while verifying
On Windows, any
dapicommand that surfaces a tool error prints the error correctly and then aborts withAssertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76. I reproduced it on unmodifiedmainwithdapi capture <unknown id>anddapi check <unknown id>, so it predates this branch and is not something this PR introduces or fixes. It looks likeprocess.exitinfail()landing while the MCP transport still has a handle open. Happy to open a separate issue if useful.🤖 Generated with Claude Code