-
Notifications
You must be signed in to change notification settings - Fork 0
fix(server): skip --resume on first headless query #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -480,7 +480,10 @@ async function handleSessionCreate( | |
| const clientId = `headless:${wtId}`; | ||
| const transport = new NullTransport(); | ||
| await startChat(transport, clientId, initialPrompt, { | ||
| resume: wtId, | ||
| // No resume — this is the first query, no SDK session exists yet. | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 style: The 4-line comment explaining why |
||
| // The SDK session UUID is captured in query-loop after the first | ||
| // assistant message and stored via updateSessionSdkId() for future | ||
| // queries (e.g. user replies from their phone). | ||
| mode: mode ?? 'agent', | ||
| model, | ||
| isolation: true, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 style: Source-code-scanning tests (reading app.ts/chat.ts as strings and asserting on substrings) are fragile — any refactor that changes whitespace, variable names, or call structure will break them silently or produce false positives. The
indexOf(');', startChatIdx)heuristic fails if the options object contains a nested);sequence (e.g. in a comment or string). Consider testing the actual behavior (e.g. mockstartChatand assert the options it receives) rather than parsing source text.