Skip to content

fix: add --append-system-prompt to code/chat/run - #3756

Open
praisonai-triage-agent[bot] wants to merge 2 commits into
mainfrom
claude/issue-3743-20260806-1029
Open

fix: add --append-system-prompt to code/chat/run#3756
praisonai-triage-agent[bot] wants to merge 2 commits into
mainfrom
claude/issue-3743-20260806-1029

Conversation

@praisonai-triage-agent

Copy link
Copy Markdown
Contributor

Fixes #3743

Summary

Adds a per-invocation --append-system-prompt flag to the code, chat and run commands, so users can append to the system prompt at launch without editing agent files or YAML:

praisonai code --append-system-prompt "Always answer in French"
praisonai run "Refactor this" --append-system-prompt @prompt.txt

Design (lightweight, per AGENTS.md)

  • No new Agent constructor param. The commands resolve the value and export PRAISONAI_APPEND_SYSTEM_PROMPT; the core Agent reads that single env var when assembling the system prompt. This one choke point serves all three commands plus YAML/Python without threading a kwarg through the many interactive-TUI/legacy agent-construction sites.
  • Two append points cover all execution routes: Agent.__init__ (non-chat path) and chat_mixin._build_system_prompt (chat/messages path, appended after the cached base + glob rules so it stays out of the cache prefix).
  • Scope trimmed: deliberately did not add SessionData.metadata persistence/resume-reapply. Sessions restore conversation history; the append is a per-invocation knob re-supplied via flag/env each run, so extra session plumbing would be scope creep with no strong consumer.

Changes

  • praisonaiagents/agent/agent.py: append env text to tail of system_prompt (no-op when unset).
  • praisonaiagents/agent/chat_mixin.py: _append_system_prompt_suffix applied at both return points of _build_system_prompt.
  • praisonai_code/cli/utils/append_prompt.py: resolve_append_system_prompt / apply_append_system_prompt helpers (stdlib only; literal, @file, env fallback).
  • commands/code.py, commands/chat.py, commands/run.py: add the Typer option and wire it in.

Tests

New tests/unit/agent/test_append_system_prompt.py — visible in prompt tail (init + chat build paths), no-op when unset/blank, not persisted to backstory, @file form, env fallback. 10 passed; related system-prompt/glob-rules/cache tests still green.

Generated with Claude Code

@MervinPraison

Copy link
Copy Markdown
Owner

@coderabbitai review

@MervinPraison

Copy link
Copy Markdown
Owner

/review

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@MervinPraison, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 180dbf13-72b5-4268-8f35-e276e70756b3

📥 Commits

Reviewing files that changed from the base of the PR and between 2a5b3d4 and 4ea5b68.

📒 Files selected for processing (7)
  • src/praisonai-agents/praisonaiagents/agent/agent.py
  • src/praisonai-agents/praisonaiagents/agent/chat_mixin.py
  • src/praisonai-agents/tests/unit/agent/test_append_system_prompt.py
  • src/praisonai-code/praisonai_code/cli/commands/chat.py
  • src/praisonai-code/praisonai_code/cli/commands/code.py
  • src/praisonai-code/praisonai_code/cli/commands/run.py
  • src/praisonai-code/praisonai_code/cli/utils/append_prompt.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds a per-invocation system-prompt suffix for the code, chat, and run commands, supporting literal values, @file input, and an environment fallback.

  • Appends the suffix after the stable prompt-cache prefix in core agent prompt assembly.
  • Keeps suffix-bearing run requests in-process so the warm daemon cannot drop the instruction.
  • Adds focused tests for prompt assembly, helper resolution, and warm-runtime bypass.

Confidence Score: 4/5

The PR is not yet safe to merge because a suffix from one in-process invocation can still alter later invocations that did not request it.

The warm-runtime loss has been addressed, but the append helper leaves its process-global environment mutation in place; a later command resolves that retained value as its fallback and core agent construction appends it again.

Files Needing Attention: src/praisonai-code/praisonai_code/cli/utils/append_prompt.py

Important Files Changed

Filename Overview
src/praisonai-code/praisonai_code/cli/utils/append_prompt.py Resolves and exports the suffix, but the previously reported process-environment leakage remains outstanding.
src/praisonai-code/praisonai_code/cli/commands/run.py Forwards the resolved suffix into direct prompt execution and correctly bypasses the warm runtime when it is present.
src/praisonai-agents/praisonaiagents/agent/agent.py Appends the environment-provided suffix during initial system-prompt construction.
src/praisonai-agents/praisonaiagents/agent/chat_mixin.py Appends the suffix after cached and path-scoped prompt content on both chat prompt-building paths.
src/praisonai-code/tests/unit/test_run_outcome_exit.py Adds regression coverage proving suffix-bearing runs bypass the warm runtime while ordinary eligible runs still attach.

Reviews (7): Last reviewed commit: "fix: keep --append-system-prompt in-proc..." | Re-trigger Greptile

Comment thread src/praisonai-code/praisonai_code/cli/commands/run.py Outdated
@MervinPraison MervinPraison added pipeline/blocked:ci Blocked: CI not green on HEAD pipeline/blocked:manual-review Blocked: requires manual review pipeline/blocked:no-final Blocked: no FINAL @claude trigger yet pipeline/final-claude-pending Reviews done; waiting for FINAL @claude labels Aug 6, 2026
@MervinPraison

Copy link
Copy Markdown
Owner

@claude You are the FINAL architecture reviewer. If the branch is under MervinPraison/PraisonAI (not a fork), you are able to make modifications to this branch and push directly. SCOPE: Focus ONLY on Python packages (praisonaiagents, praisonai). Do NOT modify praisonai-rust or praisonai-ts. Read ALL comments above from Gemini, Qodo, CodeRabbit, and Copilot carefully before responding.

Phase 1: Review per AGENTS.md

  1. Protocol-driven: check heavy implementations vs core SDK
  2. Backward compatible: ensure zero feature regressions
  3. Performance: no hot-path regressions
  4. SDK value: review in depth whether the change genuinely adds value to the SDK — never add features for the sake of adding them. It must strengthen the SDK (simpler, more user-friendly, robust, world-class, secure). If it does not clearly add value, request changes or recommend rejecting/closing rather than merging scope creep
  5. Do not bloat the Agent class with additional params — only if absolutely required; we already support many params.
  6. Repo routing: agent-callable tools → PraisonAI-Tools; lifecycle plugins → PraisonAI-Plugins; optional sandbox backends → PraisonAI-Plugins (praisonai.sandbox entry point) — request changes if wrongly added to praisonaiagents/

Phase 2: FIX Valid Issues
7. For any VALID bugs or architectural flaws found by Gemini, CodeRabbit, Qodo, Copilot, or any other reviewer: implement the fix
8. Also independently identify and fix any gaps or issues you find in the changed code — do not rely only on prior reviewer feedback
9. Push all code fixes directly to THIS branch (do NOT create a new PR)
10. Comment a summary of exact files modified and what you skipped

Phase 3: Final Verdict
11. If all issues are resolved, approve the PR / close the Issue
12. If blocking issues remain, request changes / leave clear action items

@MervinPraison MervinPraison added pipeline/awaiting-merge-gate FINAL done; waiting for merge gate / CI pipeline/blocked:cooldown Blocked: post-push or @claude cooldown and removed pipeline/final-claude-pending Reviews done; waiting for FINAL @claude pipeline/blocked:no-final Blocked: no FINAL @claude trigger yet labels Aug 6, 2026
@praisonai-triage-agent

praisonai-triage-agent Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Claude finished @MervinPraison's task —— View job


Final Architecture Review — PR #3756

  • Read AGENTS.md & review all changed files
  • Assess SDK value / scope creep per AGENTS.md
  • Investigate Greptile P1: warm-runtime run drops suffix
  • Fix valid issue & push
  • Run tests
  • Final verdict

Phase 1 — Architecture review (per AGENTS.md)

Check Verdict
Protocol-driven / core vs wrapper ✅ Core reads one env var at a single choke point; heavy CLI resolution (@file, literal, env) lives in the praisonai_code wrapper. Correct routing.
No Agent-param bloat No new Agent.__init__ param. Uses PRAISONAI_APPEND_SYSTEM_PROMPT env as the single choke point — the right call given the many interactive/legacy construction sites.
Backward compatible ✅ No-op when env unset/blank; not persisted to backstory/definitions. Zero regressions in system-prompt/cache/glob suites.
Performance / hot path ✅ Appended at the tail, after the cacheable prefix + glob rules, preserving prompt-cache discipline (#2993). Env lookup is negligible.
SDK value ✅ Genuine, common ask (#3743) — per-invocation prompt steering without editing YAML/agent files. Lightweight and useful, not scope creep.

Phase 2 — Fixed the valid issue

Greptile P1 (VALID): warm-runtime run silently dropped the suffix. The run command exported PRAISONAI_APPEND_SYSTEM_PROMPT into the CLI process env, but an eligible run forwards to the warm daemon (separate process) via _try_attach_runtime — the daemon never receives the env and reuses a cached agent whose prompt is already assembled, so --append-system-prompt was ignored on that fast path.

Fix (minimal, mirrors existing gates): exclude the warm-runtime path when the suffix is active, forcing the in-process route that correctly applies it — exactly like the existing thinking_budget / isolated / instructions gates.

Files modified (this branch):

  • src/praisonai-code/praisonai_code/cli/commands/run.py — capture resolved suffix; thread append_system_prompt into _run_prompt; add and not append_system_prompt to the runtime_eligible gate (with comment).
  • src/praisonai-code/tests/unit/test_run_outcome_exit.py — 2 regression tests: append-suffix run never attaches warm; ordinary --no-save run still does (guards against over-gating).

Independent review of other paths: code and chat are fully in-process (no daemon forward) — already correct. The profiled run path builds Agent(**config) in-process — already correct. Both Agent.__init__ (non-chat) and _build_system_prompt (chat, re-read per-turn) append points are sound.

Skipped (correctly out of scope): CodeRabbit/Qodo produced no actionable findings (rate-limited/paused). No SessionData resume-reapply plumbing added — it's a per-invocation knob re-supplied each run; adding session persistence would be scope creep with no consumer. Did not touch praisonai-rust / praisonai-ts.

Phase 3 — Tests

  • test_append_system_prompt.py: 10 passed (init + chat build paths, no-op unset/blank, not persisted, @file, env fallback).
  • test_run_outcome_exit.py: 10 passed (incl. 2 new warm-runtime gate tests).
  • Related system-prompt / cache / glob suites: 11 passed, no regressions.
  • One unrelated pre-existing failure (test_tool_resolution_boundary::test_globals_callable_not_executed_HookRunner.registry) is untouched by this PR.

Verdict: ✅ Approve

Solid, lightweight design that respects the no-Agent-bloat rule and prompt-cache discipline. The one valid architectural gap (warm-runtime bypass) is now fixed and covered by regression tests. Ready to merge.
Branch: claude/issue-3743-20260806-1029

@praisonai-triage-agent praisonai-triage-agent Bot removed pipeline/blocked:cooldown Blocked: post-push or @claude cooldown pipeline/blocked:ci Blocked: CI not green on HEAD labels Aug 6, 2026
@MervinPraison

Copy link
Copy Markdown
Owner

@claude this PR has merge conflicts with main. Please rebase onto latest main, resolve conflicts (keep this PR's intent, merge in newer main logic), run targeted tests, and force-push with --force-with-lease. Comment which files you resolved. Do not bloat the Agent class with additional params — only if absolutely required; we already support many params. Keep the resolution minimal — the aim is a lightweight and powerful package; do not introduce scope creep while resolving conflicts.

@praisonai-triage-agent

praisonai-triage-agent Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Claude finished @MervinPraison's task —— View job


Rebased PR #3756 onto latest main

  • Setup git identity & fetch main
  • Rebase onto origin/main (was DIRTY; base advanced to 80a3d65)
  • Resolve conflicts (keep PR intent + newer main logic)
  • Run targeted tests
  • Force-push with --force-with-lease

Conflict resolved (1 file)

src/praisonai-code/praisonai_code/cli/commands/code.py — the only real conflict. main had added the --print/--output headless options and a --resume continuity alias; this PR added --append-system-prompt + its resolution call. Both are purely additive and non-overlapping:

  • The option signature had already auto-merged (both --append-system-prompt and --print/--output present).
  • In the body I kept both blocks — the --resume → session_id alias from main and the apply_append_system_prompt(...) resolution from this PR.

Everything else (chat.py auto-merged; agent.py, chat_mixin.py, run.py, append_prompt.py, and both test files) applied cleanly with no conflicts.

Scope discipline

No new Agent params introduced during resolution; the single env-var choke point (PRAISONAI_APPEND_SYSTEM_PROMPT) is preserved. No praisonai-rust / praisonai-ts touched. Resolution is minimal — no new features added.

Tests (targeted, on rebased branch)

  • tests/unit/agent/test_append_system_prompt.py10 passed (init + chat-build append paths, no-op unset/blank, not persisted to backstory, @file, env fallback — all green with wrapper installed).
  • praisonai-code tests/unit/test_run_outcome_exit.py10 passed (incl. warm-runtime gate regressions).
  • No leftover conflict markers; code.py parses clean.

Final linearized history:

1e52e75 fix: keep --append-system-prompt in-process for run (warm-runtime gap)
e817da1 fix: add --append-system-prompt to code/chat/run (fixes #3743)
80a3d65 (main) Merge pull request #3757 ...

Force-pushed to claude/issue-3743-20260806-1029. PR is now conflict-free against main.
• Branch: claude/issue-3743-20260806-1029

@praisonai-triage-agent
praisonai-triage-agent Bot force-pushed the claude/issue-3743-20260806-1029 branch from b3f71ca to 1e52e75 Compare August 6, 2026 12:58
@MervinPraison MervinPraison added pipeline/blocked:ci Blocked: CI not green on HEAD pipeline/blocked:cooldown Blocked: post-push or @claude cooldown claude-ci-fix-pending and removed claude-conflict-pending labels Aug 6, 2026
@praisonai-triage-agent

praisonai-triage-agent Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Claude finished @MervinPraison's task —— View job


CI Failure Fix — PR #3756

  • Setup git & checkout branch
  • Read failing tests & source
  • Reproduce failures & determine verdict
  • Fix root cause (minimal)
  • Re-run tests
  • Push & summarize

Verdict: Pre-existing flake — root-caused, not masked (not a regression from this PR)

The two failing tests live in src/praisonai/tests/unit/cli/test_interactive_tasks_command.py, which is not touched by this PR (diff vs main is only the 8 append-system-prompt files). They exercise the shared background runner / /tasks command — completely unrelated to --append-system-prompt.

The file was added in #3733 and already carried a dedicated isolation fix (c3a3e392a) for this exact intermittent failure. Root cause under CI's pytest -n 2 --dist loadfile (worker process persists across files):

  • The old fixture reset _shared_runner but left the module-level daemon event loop _bg_loop (created by other files) alive.
  • A task still scheduled on that loop can concurrently mutate the freshly-seeded runner's _tasks, surfacing as 't1' in 'No background tasks' and an uncancelled RUNNING task.

Fix (minimal, no assertions weakened)

test_interactive_tasks_command.py — the autouse fixture now quiesces the shared background loop (_shutdown_bg_loop() + reset _bg_loop) before and after seeding, in addition to resetting _shared_runner. This removes the race so no stray daemon task from another file can repopulate the seeded singleton.

Reproduction proving the mechanism & fix (polluter task on the shared loop, then quiesce + reseed):

pending on loop: 1
after quiesce+reseed, tasks: 0
after seed t1, tasks: ['t1']
OK: no stray daemon task repopulated

SDK guardrails

  • No core SDK changepraisonaiagents/ untouched; fix is confined to a wrapper test fixture. No Agent params added.
  • No test standards lowered — list/detail/actual CANCELLED assertions all preserved; the change only removes cross-file daemon contamination.
  • Did not touch praisonai-rust / praisonai-ts.

Tests

  • tests/unit/cli/test_interactive_tasks_command.py3 passed (isolation + under -n 2 --dist loadfile).
  • PR's own ../praisonai-agents/tests/unit/agent/test_append_system_prompt.py5 passed, 5 skipped (skips are the chat-path cases needing the code wrapper), no regressions.

Files modified

  • src/praisonai/tests/unit/cli/test_interactive_tasks_command.py (+11) — fixture hardening only.

Pushed d7b41b895 to claude/issue-3743-20260806-1029.

View job • Branch: claude/issue-3743-20260806-1029

@praisonai-triage-agent praisonai-triage-agent Bot removed the pipeline/blocked:cooldown Blocked: post-push or @claude cooldown label Aug 6, 2026
@MervinPraison

Copy link
Copy Markdown
Owner

@claude this PR has merge conflicts with main. Please rebase onto latest main, resolve conflicts (keep this PR's intent, merge in newer main logic), run targeted tests, and force-push with --force-with-lease. Comment which files you resolved. Do not bloat the Agent class with additional params — only if absolutely required; we already support many params. Keep the resolution minimal — the aim is a lightweight and powerful package; do not introduce scope creep while resolving conflicts.

@praisonai-triage-agent

praisonai-triage-agent Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Claude finished @MervinPraison's task —— View job


Rebased PR #3756 onto latest main

  • Setup git identity & fetch main
  • Rebase onto origin/main (base advanced 80a3d65d169cf24c)
  • Resolve conflicts (keep PR intent + newer main logic)
  • Run targeted tests
  • Force-push with --force-with-lease

Conflict resolved (1 file)

src/praisonai-code/praisonai_code/cli/commands/chat.py — the only real conflict. main had added the --pure/--no-plugins scoping comment block; this PR added the apply_append_system_prompt(...) resolution. Both are purely additive and non-overlapping, so I kept both. The --append-system-prompt option signature had already auto-merged. Every other file (agent.py, chat_mixin.py, code.py, run.py, append_prompt.py, and all test files) applied cleanly with no conflicts.

Scope discipline

No new Agent params introduced during resolution; the single env-var choke point (PRAISONAI_APPEND_SYSTEM_PROMPT) is preserved. No praisonai-rust / praisonai-ts touched. Resolution is minimal — no new features added.

Tests (targeted, on rebased branch)

  • tests/unit/agent/test_append_system_prompt.py10 passed (init + chat-build append paths, no-op unset/blank, not persisted to backstory, @file, env fallback — all green with wrapper installed).
  • praisonai-code tests/unit/test_run_outcome_exit.py10 passed (incl. warm-runtime gate regressions).
  • praisonai tests/unit/cli/test_interactive_tasks_command.py3 passed (fixture isolation).
  • No leftover conflict markers; chat.py parses clean.

Final linearized history

12929787a fix: quiesce shared background loop in REPL /tasks test fixture
a4618fcf8 fix: keep --append-system-prompt in-process for run (warm-runtime gap)
2beb63b91 fix: add --append-system-prompt to code/chat/run (fixes #3743)
d169cf24c (main) docs: auto-update feature parity trackers [skip ci]

Force-pushed 12929787a to claude/issue-3743-20260806-1029. PR is now conflict-free against main.

View job • Branch: claude/issue-3743-20260806-1029

@praisonai-triage-agent
praisonai-triage-agent Bot force-pushed the claude/issue-3743-20260806-1029 branch from d7b41b8 to 1292978 Compare August 7, 2026 10:16
@MervinPraison MervinPraison added pipeline/blocked:cooldown Blocked: post-push or @claude cooldown and removed claude-conflict-pending labels Aug 7, 2026
"""
resolved = resolve_append_system_prompt(value)
if resolved:
os.environ[ENV_VAR] = resolved

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Prompt suffix leaks across invocations

When two CLI commands run sequentially in the same Python process and only the first supplies --append-system-prompt, this assignment leaves the first suffix in os.environ; the second invocation resolves that retained value as its environment fallback, causing its agent to receive instructions that were intended only for the earlier invocation.

Knowledge Base Used: praisonai-code

@praisonai-triage-agent praisonai-triage-agent Bot removed the pipeline/blocked:cooldown Blocked: post-push or @claude cooldown label Aug 7, 2026
@MervinPraison

Copy link
Copy Markdown
Owner

@claude this PR has merge conflicts with main. Please rebase onto latest main, resolve conflicts (keep this PR's intent, merge in newer main logic), run targeted tests, and force-push with --force-with-lease. Comment which files you resolved. Do not bloat the Agent class with additional params — only if absolutely required; we already support many params. Keep the resolution minimal — the aim is a lightweight and powerful package; do not introduce scope creep while resolving conflicts.

@praisonai-triage-agent praisonai-triage-agent Bot added the pipeline/blocked:conflict Blocked: merge conflict or rebase pending label Aug 8, 2026
@praisonai-triage-agent

praisonai-triage-agent Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Claude finished @MervinPraison's task —— View job


Rebased PR #3756 onto latest main

  • Setup git identity & fetch main
  • Rebase onto origin/main (base advanced d169cf24c5b1a437e4)
  • Resolve conflicts (keep PR intent + newer main logic)
  • Run targeted tests
  • Force-push with --force-with-lease

Conflict resolved (1 file)

src/praisonai/tests/unit/cli/test_interactive_tasks_command.py — the only conflict. Both this PR and main were independently fixing the same intermittent /tasks test flake (xdist --dist loadfile daemon-loop race). main landed a stronger fix: an isolated_runner fixture that pins a dedicated BackgroundRunner and monkeypatches get_background_runner to return exactly it, so no other file's daemon can reach the instance the handler resolves.

I kept main's isolated_runner fixture and dropped this PR's now-superseded _clear_shared_runner fixture (which only quiesced the shared loop). The test bodies already reference isolated_runner, and PR intent (isolated, green REPL /tasks tests) is fully preserved with the better mechanism. Because the resolution matched main exactly, the redundant fixture commit collapsed away, leaving a clean 2-commit history.

Every other file (agent.py, chat_mixin.py, code.py, chat.py, run.py, append_prompt.py, and the two other test files) applied cleanly — no conflicts.

Scope discipline

No new Agent params introduced; the single env-var choke point (PRAISONAI_APPEND_SYSTEM_PROMPT) is preserved. No praisonai-rust / praisonai-ts touched. Resolution is minimal — no new features, no scope creep.

Tests (targeted, on rebased branch)

  • tests/unit/agent/test_append_system_prompt.py5 passed, 5 skipped (skips are the chat-path cases needing the praisonai-code wrapper installed; init + no-op unset/blank + not-persisted + @file + env-fallback all green).
  • test_interactive_tasks_command.py — parses clean; skipped here only because interactive_legacy optional CLI deps aren't installed in this env (importorskip). Resolution verified via py_compile + no leftover conflict markers.
  • test_run_outcome_exit.py — applied cleanly (no conflict); requires typer (code-wrapper dep) to execute in this env.

Final linearized history

ba2d2cb8c fix: keep --append-system-prompt in-process for run (warm-runtime gap)
5fdf69037 fix: add --append-system-prompt to code/chat/run (fixes #3743)
5b1a437e4 (main) docs: auto-update documentation parity trackers [skip ci]

Force-pushed ba2d2cb8c to claude/issue-3743-20260806-1029. PR is now conflict-free against main.

View job • Branch: claude/issue-3743-20260806-1029

@praisonai-triage-agent
praisonai-triage-agent Bot force-pushed the claude/issue-3743-20260806-1029 branch from 1292978 to ba2d2cb Compare August 8, 2026 11:15
@MervinPraison MervinPraison added pipeline/blocked:cooldown Blocked: post-push or @claude cooldown and removed claude-conflict-pending pipeline/blocked:conflict Blocked: merge conflict or rebase pending labels Aug 8, 2026
@praisonai-triage-agent praisonai-triage-agent Bot removed the pipeline/blocked:cooldown Blocked: post-push or @claude cooldown label Aug 8, 2026
@MervinPraison

Copy link
Copy Markdown
Owner

@claude this PR has merge conflicts with main. Please rebase onto latest main, resolve conflicts (keep this PR's intent, merge in newer main logic), run targeted tests, and force-push with --force-with-lease. Comment which files you resolved. Do not bloat the Agent class with additional params — only if absolutely required; we already support many params. Keep the resolution minimal — the aim is a lightweight and powerful package; do not introduce scope creep while resolving conflicts.

@praisonai-triage-agent

praisonai-triage-agent Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Claude finished @MervinPraison's task —— View job


Rebased PR #3756 onto latest main

  • Setup git identity & fetch main
  • Rebase onto origin/main (base advanced 5b1a437e4b31ca3e36)
  • Resolve conflicts (keep PR intent + newer main logic)
  • Run targeted tests
  • Force-push with --force-with-lease

Conflict resolved (1 file)

src/praisonai-code/praisonai_code/cli/commands/run.py — the only conflict. main had added the coherent-rewind --revert block (_revert_checkpoint(...)); this PR added the apply_append_system_prompt(...) resolution right after the --restore early-return. Both are purely additive and non-overlapping, so I kept both blocks in sequence (revert first, then append-prompt resolution). The --append-system-prompt option signature auto-merged. The second commit's warm-runtime gate (resolved_append_prompt threading + and not append_system_prompt on runtime_eligible) applied cleanly on top.

Every other file (agent.py, chat_mixin.py, code.py, chat.py, append_prompt.py, and all test files) applied cleanly — no conflicts.

Scope discipline

No new Agent params introduced; the single env-var choke point (PRAISONAI_APPEND_SYSTEM_PROMPT) is preserved. No praisonai-rust / praisonai-ts touched. Resolution is minimal — no new features, no scope creep.

Tests (targeted, on rebased branch)

  • tests/unit/agent/test_append_system_prompt.py5 passed, 5 skipped (skips are the chat-path cases needing the praisonai-code wrapper installed; init + no-op unset/blank + not-persisted + @file + env-fallback all green).
  • praisonai-code tests/unit/test_run_outcome_exit.py10 passed (incl. warm-runtime gate regressions).
  • No leftover conflict markers; all three commands parse clean.

Final linearized history

ef5791141 fix: keep --append-system-prompt in-process for run (warm-runtime gap)
0dfee59e6 fix: add --append-system-prompt to code/chat/run (fixes #3743)
b31ca3e36 (main) Merge pull request #3859 ...

Force-pushed ef5791141 to claude/issue-3743-20260806-1029. PR is now conflict-free against main.

View job • Branch: claude/issue-3743-20260806-1029

praisonai-triage-agent Bot and others added 2 commits August 11, 2026 10:05
Adds a per-invocation --append-system-prompt flag to the code, chat and run
commands. The flag accepts literal text or an @file reference and falls back
to the PRAISONAI_APPEND_SYSTEM_PROMPT env var for CI.

Kept lightweight: no new Agent constructor param. The CLI exports the resolved
value via the env var and the core Agent appends it at the END of the assembled
system prompt (both the __init__ prompt and the chat _build_system_prompt path),
preserving the prompt-cache prefix (#2993) and never persisting to agent files.

Co-authored-by: MervinPraison <MervinPraison@users.noreply.github.com>
The warm runtime is a separate process that never receives the CLI's
PRAISONAI_APPEND_SYSTEM_PROMPT export and reuses a cached agent, so an
eligible `run` that forwarded to the daemon silently dropped the appended
suffix. Exclude the warm-runtime fast path when the suffix is set so the
in-process path (which applies it) is used, mirroring the existing
thinking_budget/isolated/instructions gates.

Adds regression tests: append-suffix runs never attach warm; ordinary
no-save runs still do.

Fixes Greptile P1 review on #3743.

Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
@praisonai-triage-agent
praisonai-triage-agent Bot force-pushed the claude/issue-3743-20260806-1029 branch from ba2d2cb to ef57911 Compare August 11, 2026 10:06
@MervinPraison MervinPraison added pipeline/blocked:cooldown Blocked: post-push or @claude cooldown and removed claude-conflict-pending labels Aug 11, 2026
@praisonai-triage-agent praisonai-triage-agent Bot removed pipeline/blocked:ci Blocked: CI not green on HEAD pipeline/blocked:cooldown Blocked: post-push or @claude cooldown claude-ci-fix-pending labels Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pipeline/awaiting-merge-gate FINAL done; waiting for merge gate / CI pipeline/blocked:manual-review Blocked: requires manual review

Projects

None yet

1 participant