Input: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
Steps
Select the change
If a name is provided, use it. Otherwise:
Infer from conversation context if the user mentioned a change
Auto-select if only one active change exists
If ambiguous, run openspec list --json to get available changes and use the AskUserQuestion tool to let the user select
Always announce: "Using change: " and how to override (e.g., /opsx-apply <other>).
Check status to understand the schema
openspec status --change "<name>" --json
Parse the JSON to understand:
schemaName: The workflow being used (e.g., "spec-driven")
Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
Signal model expanded with severity buckets in src/types/index.ts.
GitHub signal endpoint normalization + unavailable/error mapping completed in .
User
In demo mode, when asking the chatbox questions, I do not see any results. The summary function works and I can see GPU activity.
Assistant
Thanks — that symptom is consistent with a streaming parse gap, not model inactivity.
Most likely cause from current code:
chatStream() only emits chunks from choices[0].delta.content in src/services/llm.ts:115.
Some OpenAI-compatible backends/models stream text in alternate fields (for example reasoning deltas or array-style content parts), so GPU runs but UI receives zero appendable text.
Summary still works because it uses non-stream chat() path, which reads message.content from the final response.
What I’d do next (no edits yet, just plan):
Reproduce and inspect one chat stream payload in browser network to confirm actual delta shape.
Update stream parsing to support common variants (string content, array content parts, and reasoning-style fields when no content exists).
Add a safety fallback: if stream completes with zero visible text, do one non-stream request and render that result.
User
LM Studio with google/gemma-4-e4b
Assistant
Perfect, that aligns with the likely root cause.
google/gemma-4-e4b via LM Studio often uses OpenAI-compatible streaming with non-delta.content fields in some turns, so our parser in src/services/llm.ts can end up yielding nothing even though generation is happening.
Plan
Update stream extraction in src/services/llm.ts to handle multiple delta shapes, not only choices[0].delta.content:
string content
array content parts ([{ type: "output_text", text: "..." }])
reasoning-style fields (reasoning_content / thinking) as fallback when no regular content exists
Add a “zero-visible-output” safeguard in ChatWindow flow (src/components/ChatWindow.tsx):
User
1
Assistant
Great — we’ll go with show reasoning text as normal assistant output when that’s all the stream provides.
Here’s the implementation plan (no changes made yet):
Update streaming parser in src/services/llm.ts to extract text from multiple chunk shapes in priority order:
choices[].delta.content (string)
choices[].delta.content (array parts like output_text / text)
fallback reasoning fields (reasoning_content, thinking, etc.) when regular content is absent
Keep output deterministic and safe:
User
check in the existing changes and archive the openspec plan. Then work on your suggested fixes
Assistant
Done — I completed the check-in + archive flow first, then implemented the LM Studio/Gemma chat fix.
Check-in + Archive
Committed existing work as 3b7a0e2 with message: feat(review): fuse CI and scanning signals into review flow.
Tried openspec archive -y add-ci-and-code-scanning-signal-fusion, but OpenSpec spec-sync validation blocked on openspec/specs/pr-review-summary/spec.md format.
Mark task complete in the tasks file: - [ ] → - [x]
Continue to next task
Pause if:
Task is unclear → ask for clarification
Implementation reveals a design issue → suggest updating artifacts
Error or blocker encountered → report and wait for guidance
User interrupts
On completion or pause, show status
Display:
Tasks completed this session
Overall progress: "N/M tasks complete"
If all done: suggest archive
If paused: explain why and wait for guidance
Output During Implementation
## Implementing: <change-name> (schema: <schema-name>)
Working on task 3/7: <task description>
[...implementation happening...]
✓ Task complete
Working on task 4/7: <task description>
[...implementation happening...]
✓ Task complete
Output On Completion
## Implementation Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 7/7 tasks complete ✓
### Completed This Session
- [x] Task 1
- [x] Task 2
...
All tasks complete! Ready to archive this change.
Output On Pause (Issue Encountered)
## Implementation Paused
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 4/7 tasks complete
### Issue Encountered
<description of the issue>
**Options:**
1. <option 1>
2. <option 2>
3. Other approach
What would you like to do?
Guardrails
Keep going through tasks until done or blocked
Always read context files before starting (from the apply instructions output)
If task is ambiguous, pause and ask before implementing
If implementation reveals issues, pause and suggest artifact updates
Keep code changes minimal and scoped to each task
Update task checkbox immediately after completing each task
Pause on errors, blockers, or unclear requirements - don't guess
Use contextFiles from CLI output, don't assume specific file names
Fluid Workflow Integration
This skill supports the "actions on a change" model:
Can be invoked anytime: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
Allows artifact updates: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
src/services/github.ts
Signal lifecycle orchestration wired into PR context loading in src/store/slices/prsSlice.ts (including head-SHA-triggered reload behavior).
Summary/chat signal fusion integrated in src/services/llm.ts using shared snapshot builders from src/services/signals.ts.
Chat now passes signal context into system prompt generation in src/components/ChatWindow.tsx.
New Signals UI tab (loading/success/pending/unavailable/error semantics + ranked highlights) added in src/components/PRViewer.tsx.
Sidebar duplicate signal fetch removed since orchestration is now slice-driven in src/components/Sidebar.tsx.
Verification coverage added/expanded in:
src/services/github.test.ts
src/services/llm.test.ts
src/services/signals.test.ts
src/store/slices/prsSlice.test.ts
src/components/PRViewer.signals.test.tsx
OpenSpec task checklist fully marked complete in openspec/changes/add-ci-and-code-scanning-signal-fusion/tasks.md.
Plan log updated in plans/plan.md.
Validation
Ran npm run lint -- --max-warnings=0 ✓
Ran npm run build ✓
Ran npm run test ✓ (18 files, 154 tests passing)
All tasks are complete. This change is ready to archive via the archive workflow.
chat()
Add tests in src/services/llm.test.ts for these alternate SSE payloads and empty-stream fallback behavior.
Add one integration test in src/components/ChatWindow.test.tsx ensuring assistant message is populated when stream chunks are non-standard.
If you want, I can execute that fix next.
One quick detail that helps me pick the best parser paths: which backend/model are you using in demo mode (e.g. LM Studio, Ollama, vLLM, LiteLLM + model name)?
if stream completes with empty visible text, do one non-stream chat() call and render that result
keep current error behavior unchanged for true API failures
Add unit tests in src/services/llm.test.ts for LM Studio/Gemma chunk variants (including no delta.content case).
Add/extend chat integration tests in src/components/ChatWindow.test.tsx to verify user-visible assistant output for non-standard stream chunks.
Optional usability tweak: if only reasoning text is emitted, prefix discreetly (e.g. “Model reasoning: …”) or treat it as normal assistant content.
One preference before I implement:
Recommended: show reasoning tokens as normal assistant text when that’s all we get.
Hide reasoning tokens and only show final answer text (if present).