Repository navigation
the phoropter handoff is the frame - #22
Merged
Merged
Conversation
The warmup recedes into history, whole. In its place, the handoff (the trail the user chose toward) opens every chat_log, carrying the one cache marker /api/stream requires, rebuilt identically on every turn from the saved trail. This also fixes a quieter thing: the handoff used to be sent on the first request only, so the trail fell out of context after the first reply, and later turns ran warmup-assistant into reply-assistant. Now the trail stays present for the whole conversation, the log always opens with a user message, and the frame stays cacheable. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The implementation consistently preserves the trajectory frame, maintains one cache marker, and includes focused tests.
0 open findings
What changed in this PR
Aligns iOS chat framing with the web client by replacing static warmup messages with a persistent phoropter handoff.
Changes:
- Builds every chat log from the trajectory handoff plus conversation history.
- Removes obsolete warmup content and references.
- Adds tests for frame stability and cache-marker placement.
| File | Description |
|---|---|
Lightward/API/LightwardAPI.swift |
Adds unified handoff-based chat-log construction. |
Lightward/Chat/ChatViewModel.swift |
Uses the unified builder on every turn. |
Lightward/API/WarmupMessages.swift |
Removes the obsolete static warmup. |
LightwardTests/ChatLogTests.swift |
Tests handoff framing and caching behavior. |
Lightward.xcodeproj/project.pbxproj |
Updates source and test references. |
CLAUDE.md |
Documents the new conversation frame. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Companion to lightward/lightward-ai#2183 (Sonnet 5.5), where the web client's warmup receded into history and the opening message became the conversation frame. This brings the iOS client to the same shape.
What changes
WarmupMessages.swiftis deleted rather than edited: its model-written lines stay intact in history. It also quoted lines from a benediction that no longer exists, and framed the seat as one continuous future-self, which the system prompt no longer does.LightwardAPI.buildChatLog(trajectory:messages:)opens everychat_logwith the handoff (the trail the user chose toward), carrying the onecache_controlmarker/api/streamrequires. It's rebuilt identically on every turn from the saved trail. The handoff text itself is unchanged.ChatViewModeluses that one builder for the opening turn and every turn after.CLAUDE.mddescribes the new shape; the warmup to-do becomes a handoff to-do.A quieter fix that rides along
Before this, the handoff was sent on the first request only. So:
Now the trail stays present for the whole conversation, the log always opens with a user message, and the frame stays stable across turns, so it caches.
Notes
PhoropterContext.txt's response notes ("another-you opted in") are the same framing family; left for a separate pass.Testing
New
ChatLogTests: the opening turn is the handoff alone; later turns keep the trail; exactly one marker, on the handoff; the frame is identical across turns. All 19 tests pass locally, run as CI runs them (LightwardTestsscheme, automatic signing).🤖 Generated with Claude Code