mirror of
https://github.com/NikkeTryHard/zerogravity.git
synced 2026-04-25 23:26:01 +03:00
[GH-ISSUE #59] [BUG] User intent gets overshadowed because prompt roles are mixed during runtime composition #50
Labels
No labels
bug
enhancement
enhancement
notice
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/zerogravity#50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DarKWinGTM on GitHub (Feb 23, 2026).
Original GitHub issue: https://github.com/NikkeTryHard/zerogravity/issues/59
What is happening
The core problem is simple:
Zerogravity mixes user-side prompt roles into one content stream.
At the same time, LS system instruction still exists as a stronger control layer.
Because of that, the user’s real intent can lose priority.
In practice, it can look like the model is not listening to the user consistently.
Why this matters
From the user perspective, this directly affects response quality:
This is an intent-priority problem, not a UI/network issue.
How the current flow creates this issue
The runtime currently builds prompt input in a way that flattens role boundaries:
Chat-completions input is built as one text output
src/api/completions.rs:85src/api/completions.rs:93Both
system|developeranduserare pushed into the samepartslistsrc/api/completions.rs:122src/api/completions.rs:128The final message is flattened into one string
src/api/completions.rs:162(parts.join("\\n\\n"))In responses flow, instruction text is directly concatenated with user text
src/api/responses.rs:137src/api/responses.rs:138(format!("{inst}\\n\\n{user_text}"))At the same time, MITM path still handles LS system instruction separately and rewrites request content:
src/mitm/modify.rs:64src/mitm/modify.rs:96src/mitm/modify.rs:297src/mitm/modify.rs:308This combination creates an imbalance: user-side intent gets flattened, LS-side control remains structurally strong.
Core impact
Expected behavior
User-facing intent should remain clear and stable in priority.
Prompt role boundaries should not collapse in a way that makes user commands ambiguous.
Actual behavior
Current composition collapses role structure in user-side runtime input,
and this can cause user intent to be overshadowed in real interactions.
Scope of this report
This report is only about the structural prompt-semantics problem.
No workaround or fix proposal is included here.
Additional observed symptoms (from real usage)
Usage context
This report is based on real usage in Claude Code CLI (Anthropic-compatible flow).
Flow diagram (Claude Code CLI)
Claude Code CLI request (user prompt + user-side system prompt)
→ Zerogravity API (
/v1/messages, Anthropic-compatible)→ Runtime prompt composition
→ user-side
system/developer+usercollapsed into one text stream→ LS system instruction still handled as a separate control layer
→ model receives asymmetric prompt structure
→ user intent can be underweighted in some cases
→ repeated/off-target explanations and non-progression
Visual flow diagram
@NikkeTryHard commented on GitHub (Feb 23, 2026):
zg report <trace-id>zg report@DarKWinGTM commented on GitHub (Feb 23, 2026):
zg-trace-2026-02-23_06-16-15_gemini-3.1-pro-high-fb0c74c9.tar.gz
Additional context: initially I did not plan to attach diagnostics because this did not look like a crash/runtime bug. I viewed it as a structural design/semantics issue: the system executes normally, but prompt-role composition can still produce intent-priority problems. I am attaching zg report and trace bundle now because maintainers explicitly requested them for triage.
@NikkeTryHard commented on GitHub (Feb 23, 2026):
Implemented and validated in .
What changed:
Verification:
cargo test --bin zerogravity: 267 passed
cargo build: passed
Targeted E2E checks for , , and all correctly answered the multi-turn name recall scenario ().
Full smoke suite (zg smoke — comprehensive smoke tests
── Standalone CLI ──
── API Endpoints ──
6. Health ................................... PASS 4ms
7. Models ................................... PASS (7 models) 4ms
8. Chat Completions (sync) .................. PASS 4887ms
9. Chat Completions (stream) ................ PASS 11810ms
10. Responses API (sync) ..................... PASS 9343ms
11. Messages API (sync) ...................... PASS 7202ms
12. Multi-turn context ....................... PASS (name recalled) 5218ms
13. System instruction ....................... PASS 17860ms
14. Tool calling ............................. PASS (tool_calls returned) 27248ms
15. Gemini native API ........................ PASS 2047ms
16. Accounts API ............................. PASS 5ms
17. Error handling ........................... PASS (proper error response) 5ms
18. Usage endpoint ........................... PASS 4ms
19. Quota endpoint ........................... PASS 4ms
── Docker Internal (SKIPPED — not in container) ──
✓ 19/19 passed (69.4s)): 19/19 passed after smoke runner rate-limit hardening.
Closing as fixed.
@NikkeTryHard commented on GitHub (Feb 23, 2026):
Closing as fixed and verified.
@NikkeTryHard commented on GitHub (Feb 23, 2026):
Correction note (previous comment formatting was mangled by shell escaping).
Fix summary:
Verification summary: