Skip to content

fix(play): solo cold-open starts the player ALONE — no auto-recruited companion (G6); G5 streaming verified already-works - #414

Closed
100yenadmin wants to merge 1 commit into
mainfrom
fix/gui-companion-streaming
Closed

fix(play): solo cold-open starts the player ALONE — no auto-recruited companion (G6); G5 streaming verified already-works#414
100yenadmin wants to merge 1 commit into
mainfrom
fix/gui-companion-streaming

Conversation

@100yenadmin

@100yenadmin 100yenadmin commented May 30, 2026

Copy link
Copy Markdown
Member

Two play-experience bugs. Scope: scripts/play.sh only (engine + skill verified, not changed). Engine stays the sole writer; no wire contracts / --resume / persist_beat batching touched.

Do NOT close on merge — verify on the next 8799 + .app playtest.

Note: origin/main advanced past the commit this work assumed — servers/engine/seed_baldursgate.py no longer exists (seeding is consolidated into generator.py), and skills/dungeon-master/SKILL.md already contains the G5 streaming guidance. Findings below are against current origin/main and confirmed by live solo play.sh runs + a deterministic engine probe.


G6 — "a companion was just THERE with no reason" (solo cold-open) — FIXED

Where the companion was seated (trace):

  • The engine seed path is already correct on main. server.start_world("baldurs-gate") seeds the party empty — verified deterministically: get_state party length is 0 immediately after start_world. questgen.py records the cold-open companion as a prelude REFERENCE only (0 party.append, 0 add_to_party); every party.append in the engine lives inside the recruit / load_canon_character tools, gated on add_to_party/kind.
  • The companion was seated at PLAY time, by scripts/play.sh's solo cold-open prompt. Both branches — the authored-hero path and the DM-invents-PC path (byte-identical lines, MD5 matched) — instructed the DM: "A companion should ENTER as part of that opening scene … Recruit them into the party as that meeting lands." So a "solo" run recruited a sidekick on the very first DM turn.

Reproduced live (before fix): a solo play.sh cold-open produced a 2-member party — the PC plus a silently-seated companion (the verified bug).

Fix (option a — solo starts alone): rewrite that instruction in both cold-open branches so a SOLO session starts with the player ALONE — the DM does not recruit a companion at cold-open (no recruit_companion / load_canon_character(add_to_party=true) for a sidekick, and no companion in the party). Companions are met later, in play, and only then introduced on-screen and recruited (the "voiced, with a real wound and a reason they fall in together" craft guidance is preserved, just deferred to the meeting). A roster figure may still appear as a face in the world, but not as a party member.

  • Engine untouched (its reference-only prelude already keeps the companion available to be met later).
  • play_party.sh — the multi-agent path where a pre-seeded AI companion is intended — untouched.
  • Engine stays the sole writer.

Verified live (after fix): a fresh solo play.sh cold-open produced a 1-member party — the PC only; the opening narration names no companion. Before → after: party 2 → 1. Acceptance met.

Diff: 1 file, 2 lines (bash -n clean).

G5 — "I can't see the DM streaming" — VERIFIED ALREADY WORKS (no change)

skills/dungeon-master/SKILL.md on current main already contains both pieces the task asked for:

  • Streaming (a dedicated "## Streaming your narration" section): "Stream your narration to the player as you write it, not in one dump at the end of the turn"; "Open with prose immediately. Your FIRST act on a beat is a short log_event(kind="narration", …)"; "Persist beat at the end. After the prose has streamed, call persist_beat to commit the STATE deltas."
  • Paragraph breaks (the "## Format your narration" section): "Separate distinct beats with a blank line (two newlines) so paragraphs render as paragraphs." (This is the sibling render PR — the base commit here is literally fix(viewer): promote action palette into main column + render chronicle paragraphs #411 "render chronicle paragraphs".)

The viewer's /events reads the live chronicle (the log_event sink) with a since/seq cursor, so mid-turn narration surfaces immediately. A live beat confirmed narration appearing incrementally mid-turn (the /events count climbed across the turn rather than jumping once at the end) with \n\n paragraph breaks present.

Verdict: streaming + paragraph breaks already work end-to-end on current origin/main. Per "if streaming already works, say so and make no change," no skill change was made (no fabricated fix).


Verification notes

  • The change is a DM-prompt string in scripts/play.sh (no engine code path); validated by bash -n + a deterministic engine probe (empty seed party) + live before/after solo runs (party 2 → 1).
  • The local claude -p DM lane was intermittently dropping turns during testing (an environment/rate-limit condition, unrelated to this prompt change) — hence the do-not-close note and the ask to re-confirm on the real 8799 / .app playtest.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed opening scene to ensure players begin their adventure solo, with companions now properly introduced later through gameplay progression rather than at the start.

Review Change Stack

… companion (G6)

G6 — "a companion was just THERE with no reason" (solo cold-open):
A fresh SOLO play.sh session opened with a companion already in the party with
no earned, in-fiction meeting. Reproduced live: a solo cold-open seated a
2-member party [PC + a silently-added companion].

Trace — the engine seed path is already correct on main:
- server.start_world("baldurs-gate") seeds the party EMPTY (verified
  deterministically: party length 0 immediately after start_world).
- questgen.py records the cold-open companion as a prelude REFERENCE only
  (0 party.append, 0 add_to_party); every engine party.append lives in the
  recruit / load_canon_character tools, gated on add_to_party / kind.
The companion was seated at PLAY time: play.sh's solo cold-open prompt — BOTH
the authored-hero branch and the DM-invents-PC branch (byte-identical lines) —
told the DM "A companion should ENTER as part of that opening scene ... Recruit
them into the party as that meeting lands." So a "solo" run recruited a sidekick
on the very first DM turn.

Fix: rewrite that instruction in both cold-open branches so a SOLO session
starts with the player ALONE — the DM does NOT recruit a companion at cold-open
(no recruit_companion / load_canon_character add_to_party=true for a sidekick,
and no companion in the party). Companions are MET later, in play, and only then
introduced on-screen and recruited; a roster figure may still appear as a face
in the world but not as a party member. The engine is untouched (its
reference-only prelude already keeps the companion available to be met later).
play_party.sh (the multi-agent path, where a pre-seeded AI companion IS
intended) is untouched. Engine stays the sole writer.

Verified live (before -> after): solo cold-open party 2 -> 1 (PC only); the
opening narration no longer names a companion.

G5 ("I can't see the DM streaming") was VERIFIED on current main and already
works — no change made. skills/dungeon-master/SKILL.md already has a
"Streaming your narration" section ("Stream your narration as you write it, not
in one dump at the end of the turn"; "Your FIRST act on a beat is a short
log_event(kind=narration)"; "Persist beat at the end") AND a "Format your
narration" line ("Separate distinct beats with a blank line (two newlines) so
paragraphs render as paragraphs"). The viewer's /events reads the live chronicle
(log_event sink) with a since/seq cursor, and a live beat showed narration
appearing incrementally mid-turn with paragraph breaks. No fabricated fix.
@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6e23d280-d4f2-4c2a-a705-28ae50f8b6ba

📥 Commits

Reviewing files that changed from the base of the PR and between b23884c and df36539.

📒 Files selected for processing (1)
  • scripts/play.sh

📝 Walkthrough

Walkthrough

This PR modifies the Dungeon Master prompt instructions in scripts/play.sh to enforce solo party composition during the opening scene. Both the pre-seeded hero flow and the default hero-selection flow now explicitly forbid companion recruitment at session start, deferring companion introduction until later in-play.

Changes

Solo party enforcement in DM cold-open instructions

Layer / File(s) Summary
Solo party enforcement in DM cold-open
scripts/play.sh
DM opening-scene instructions are updated to explicitly require a solo party and forbid companion recruitment at session start, applied to both the HERO_CAMP (pre-seeded hero) and non-HERO_CAMP (default hero selection) DM instruction branches.

Possibly related PRs

  • electricsheephq/WorldOS#412: Both PRs modify scripts/play.sh to change the cold-open Dungeon Master prompt so the player starts solo with no auto-recruited companion; they touch the same DMSG opening-scene instructions in both HERO_CAMP branches.
  • electricsheephq/WorldOS#388: Both PRs modify the scripts/play.sh cold-open first-DM-turn prompt text to control what the DM's initial player-facing output is.

Poem

🐰 The party gathers, one heart and soul,
No sidekick joins the opening role,
Just hero bold, without a friend,
In solo quest from start to end—
Companions earned, not given free! 🎲


🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is comprehensive and addresses the template, but the Licensing/CLA checkbox section is not filled out, which is a required template element. Complete the Licensing/CLA section by checking the required checkboxes to confirm CLA acceptance and that no restricted material is included.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing a bug where solo cold-open sessions auto-recruited a companion, now ensuring the player starts alone.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix/gui-companion-streaming

Comment @coderabbitai help to get the list of available commands and usage tips.

@100yenadmin

Copy link
Copy Markdown
Member Author

Superseded: solo cold-open starting the player ALONE (G6) landed on main via #412 (b23884c) — scripts/play.sh L357/370 carry the cleaner rewrite. This PR edits the pre-rewrite text. Closing.

@100yenadmin 100yenadmin closed this Jun 5, 2026
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