Skip to content

Fix chatbot output formatting and casing#2

Closed
google-labs-jules[bot] wants to merge 1 commit intomainfrom
fix-chatbot-formatting-5233356091902702091
Closed

Fix chatbot output formatting and casing#2
google-labs-jules[bot] wants to merge 1 commit intomainfrom
fix-chatbot-formatting-5233356091902702091

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

This change addresses user feedback regarding the chatbot's output formatting. The user reported issues with "ALL CAPS" text and broken Markdown tables.

Changes:

  1. CSS/UI: Removed uppercase CSS classes from thead and h3 components in OracleInterface.tsx. This prevents the UI from forcing capitalization on text that should be sentence case.
  2. Text Processing (API):
    • Rewrote fixAllCaps in route.ts. The new implementation uses a more robust regex to detect screaming caps (including lines with pipes | for tables), converts them to sentence case, and intelligently preserves a list of domain-specific words (Planets, Signs, Acronyms).
    • Improved fixTableFormatting in route.ts to better detect table header rows (even if they don't start with a pipe) and inject missing separator lines. This ensures that tables generated by the LLM are rendered as proper Markdown tables instead of broken text.

These changes ensure that the chatbot output is consistent, readable, and respectful of the user's preference for sentence case.


PR created automatically by Jules for task 5233356091902702091 started by @DHCross

- Modify `OracleInterface.tsx` to remove enforced uppercase styling on table headers and h3 elements.
- Update `route.ts` with improved `fixAllCaps` logic to handle tables and implement true sentence case while preserving domain terms.
- Update `route.ts` with improved `fixTableFormatting` to better detect and repair malformed markdown tables from the LLM.
- Ensure chatbot output renders cleanly as sentence-case text or properly formatted tables.
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@DHCross DHCross closed this Dec 15, 2025
@DHCross DHCross deleted the fix-chatbot-formatting-5233356091902702091 branch December 30, 2025 03:39
DHCross added a commit that referenced this pull request Jan 11, 2026
DHCross added a commit that referenced this pull request Mar 2, 2026
…ge clarity

HIGH priority:
- #6 symbolicWeather: soft-fail instead of re-throwing AuthorityViolationError
- #7 TTS: add 10s AbortController timeout to ElevenLabs fetch (504 on timeout)
- #9 injectProtocols: wrap in try/catch, continue without corpus on failure

MEDIUM priority:
- #2 LLM auth: normalize 401/403 to user-friendly message
- #3 LLM timeout: add one retry in generateReplyWithRetry
- #4 Empty LLM response: distinguish content_filter from true empty
- #5 AuthorityViolation outer catch: hide internal module names

LOW priority:
- #1 Missing LLM key 503: clearer operator message
- #8 useOracleChat: map 413 to user-friendly 'message too long' text
- #10 Remove void-cast needsConcreteRetry/needsProtocolRepair calls
DHCross pushed a commit that referenced this pull request Apr 25, 2026
…m-only schema

Original: the chat pipeline's eight hardcoded silence-route fallbacks
narrated infrastructure status (provider 500, finalize crash, soft timeout,
missing relational scaffold, etc.) using the doctrinal FIELD/MAP/VOICE
three-channel grammar. That schema is reserved for symbolic readings; using
it for telemetry trains both the user and any model that ingests transcripts
to read mechanical failure as archetypal content.

- New module vessel/src/app/api/raven-chat/recoveryMessages.ts collects all
  eight operational fallback strings in one diff-able place.
- A doctrine-boundary doc comment at the top spells out: this is system-only
  language, the chosen schema is "SYSTEM: <subsystem> REASON: <why> ACTION:
  <next step>", and FIELD/MAP/VOICE labels must NOT be borrowed here.
- Three static constants (STREAM_REPLY_RESPONSE_MISSING,
  RELATIONAL_FALLBACK_SNAPSHOT_MISSING, PROVIDER_STREAM_NULL_BODY) and four
  builders (relational mapping unavailable, provider stream open failed,
  stream finalize failed, handler soft timeout) cover all interpolations.
- All eight call sites in route.ts and streamReply.ts rewired to the module.
  systemNotice payloads, applyTelemetrySignalVoid calls, and the
  RECOVERY_NOTICE_LABELS badge in page.tsx are unchanged.

- npm run typecheck passes (full tsc --noEmit).
- Spot-check via tsx confirms all 8 messages render with SYSTEM/REASON/ACTION
  and contain no FIELD:/MAP:/VOICE: leaks.
- Restarted dev workflow compiles and serves HTTP 200.
- Raven-chat unit tests: 2 failures (promptLines #1, enrichmentPhase #2) are
  preexisting on the baseline commit and unrelated; promptLines.test.ts is
  explicitly out of scope per the task brief.

Deviation: production "next build" did not complete in the agent timebox
(Webpack stalled in "Creating an optimized production build" under shared
CPU; same behaviour on baseline). Typecheck is the strongest static guarantee
available and it passes.

Replit-Task-Id: fa02d591-6763-4a20-908a-cb18c503cbb9
DHCross added a commit that referenced this pull request Apr 28, 2026
…nal void (invariant #2)

When buildStructuredSymbolicMomentReply returns signalVoid:true or throws,
the route was discarding the integrity-checked LLM reply in favour of a cold
'The geometry is present...' backstage-adjacent string.

Capture llmReplyFallback before the assembly block.  Use it instead of
SIGNAL_VOID_REPLY on both the signalVoid path and the catch path.  The
fallback has already cleared integrity checks and stripBackstagePlannerLanguage
so it is the correct frontstage carry-through.

The composer (composeSymbolicMomentNarrative) was never absent from the
runtime — it is called by buildStructuredSymbolicMomentReply.  The gap was
solely in the failure paths discarding the usable LLM output.
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.

1 participant