Skip to content

🤖 fix: add completion discipline to system prompt#2273

Merged
ibetitsmike merged 1 commit intomainfrom
mike/completion-discipline-system-message
Feb 8, 2026
Merged

🤖 fix: add completion discipline to system prompt#2273
ibetitsmike merged 1 commit intomainfrom
mike/completion-discipline-system-message

Conversation

@ibetitsmike
Copy link
Contributor

Summary

Adds an explicit <completion-discipline> block to Mux’s generated system prompt prelude to reduce premature “done” responses and encourage running relevant validation before claiming success.

Implementation

  • Inserted a new <completion-discipline> section into the system prompt prelude.
  • Added/updated tests to assert the new section is present.
  • Regenerated synced docs (docs/agents/system-prompt.mdx).

Validation

  • bun test src/node/services/systemMessage.test.ts
  • make static-check

Risks

Low. This only changes the instruction text used for agent runs; behavior impact is limited to improved completion/validation habits.


Generated with mux • Model: openai:gpt-5.2 • Thinking: xhigh • Cost: $0.12

@ibetitsmike ibetitsmike merged commit df2ef15 into main Feb 8, 2026
23 checks passed
@ibetitsmike ibetitsmike deleted the mike/completion-discipline-system-message branch February 8, 2026 23:36
ammario pushed a commit that referenced this pull request Feb 9, 2026
## Summary

Removes 4 tautological tests across 3 files that only asserted hardcoded
strings appear in output where those strings are static constants —
providing zero behavioral coverage and adding maintenance burden (any
prompt wording change requires updating tests that test nothing).

## Background

PR #2273 highlighted the pattern: when the system prompt `PRELUDE` gains
a new section, tests get added that assert the exact static text appears
in the output of `buildSystemMessage()`. Since `PRELUDE` is
unconditionally included via `PRELUDE.trim()`, these tests are
tautological — they verify a template literal contains its own content.

A broader scan found the same anti-pattern in two other test files.

## Implementation

**Removed tests (4 tests, 15 tautological assertions):**

| File | Test | Assertions | Mirrors |
|------|------|-----------|---------|
| `systemMessage.test.ts` | "includes mux_subagent_report guidance in
the system prompt" | 6 | `PRELUDE` constant (`<completion-discipline>`,
`<subagent-reports>`) |
| `modeUtils.test.ts` | "includes instructions to use
ask_user_question..." | 4 | Static return text of
`getPlanModeInstruction()` |
| `modeUtils.test.ts` | "includes sub-agent delegation guidance" | 3 |
Static return text of `getPlanModeInstruction()` |
| `agentDefinitionsService.test.ts` | "Ask agent instructs to trust
Explore sub-agent reports" | 2 | Static content from `ask.md` built-in
agent |

**Kept tests** — all remaining tests in these files exercise real
conditional logic: file reading, model-section regex matching,
precedence/fallback behavior, instruction scoping, `planExists`
branching, etc.

## Risks

Low. Only removes tests that provided no behavioral signal. All
remaining tests pass.

---

_Generated with `mux` • Model: `anthropic:claude-opus-4-6` • Thinking:
`xhigh` • Cost: `$0.00`_

<!-- mux-attribution: model=anthropic:claude-opus-4-6 thinking=xhigh
costs=0.00 -->
ammar-agent added a commit that referenced this pull request Feb 9, 2026
Move benchmark-validated instructions from bench-specific AGENTS.md into
the system prompt PRELUDE as <task-execution> section. Extract Mike's
<completion-discipline> (PR #2273) into its own guarded function with
the same BENCHMARK-VALIDATED comment treatment.

Both sections are clearly marked so they aren't flippantly modified:
- buildCompletionDiscipline() — origin PR #2273
- buildTaskExecutionGuidelines() — origin PR #2269

Removed the bench-specific AGENTS.md file + upload/deploy plumbing
since instructions now ship in the system prompt for all users.
ammar-agent added a commit that referenced this pull request Feb 9, 2026
Move benchmark-validated instructions from bench-specific AGENTS.md into
the system prompt PRELUDE as <task-execution> section. Extract Mike's
<completion-discipline> (PR #2273) into its own guarded function with
the same BENCHMARK-VALIDATED comment treatment.

Both sections are clearly marked so they aren't flippantly modified:
- buildCompletionDiscipline() — origin PR #2273
- buildTaskExecutionGuidelines() — origin PR #2269

Removed the bench-specific AGENTS.md file + upload/deploy plumbing
since instructions now ship in the system prompt for all users.
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