Skip to content

Feat/v0.5 loop reenable - #11

Merged
LikeDreamwalker merged 4 commits into
mainfrom
feat/v0.5-loop-reenable
Jul 27, 2026
Merged

Feat/v0.5 loop reenable#11
LikeDreamwalker merged 4 commits into
mainfrom
feat/v0.5-loop-reenable

Conversation

@LikeDreamwalker

Copy link
Copy Markdown
Collaborator

No description provided.

LikeDreamwalker and others added 4 commits July 28, 2026 03:24
1. Cookie-based persona resolution (demo-fs.ts):
   Module-level currentPersona does not survive across serverless
   requests. SSR sets it in instance A, but server actions may hit
   instance B where it defaults to 'personal_14'. Fix: persist
   persona selection via cookie set during page SSR, read back in
   getCurrentPersona() for server actions and API routes.

2. Turn parser regex inconsistency (turn-parser.ts):
   TURN_HEADER_RE used '--' (two ASCII hyphens) and \d+ (numeric
   turn IDs only). Manager.ts serializeSlice uses em-dash '—' (U+2014)
   and base64url turn IDs. When the agent calls readSlice with a
   range parameter, parseTurns matched zero turns and returned
   '_(No turns matched the requested range.)_'. Fix: use em-dash
   and \S+ consistently across both parsers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Server actions cannot access searchParams on the server side. The
client component now reads persona from window.location.search and
passes it as a parameter to getEpisodicState/getMoreSlices/
getSliceContent. Each server action calls setDemoPersona() on entry
so all downstream reads use the correct persona.

Reverted the cookie-based resolvePersona() approach in demo-fs.ts —
back to simple module-level currentPersona with optional persona
override on readFileDemo/listFilesDemo.

Also fixed turn-parser.ts regex: em-dash separator + \S+ turn IDs
to match manager.ts serializeSlice format.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Gray-matter parses unquoted YAML list values containing ': ' (colon +
space) as key-value objects instead of strings. e.g.:
  - Draft guide on the model: retention chain
becomes { 'Draft guide on the model': 'retention chain' }

React Error #31 when HistoricalChatView renders these as children.
Added normalizeString / normalizeStringArray helpers in parseSlice
to coerce objects back to strings.

Affects 4 slices in personal_14 with unquoted open_loops.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Extend normalizeStringArray to related_slices and loops as well.
emotional_tone is a union literal type, kept as-is.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
previously Building Building Preview, Comment Jul 27, 2026 7:57pm

@LikeDreamwalker
LikeDreamwalker merged commit 1937736 into main Jul 27, 2026
1 of 2 checks passed
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