Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ resumes the same session (`claude -p --resume <session id>`) unless the context
a fresh short prompt with the scrubbed tail (1,500 characters, credentials masked) of what the run said, asking it
to inspect the checkout (`git branch --show-current`, `git status -sb`, `git log`). If the Coding run's commits never
reached origin, the follow-up pushes that one branch (`git push -u origin <branch>`, never forced, never another
branch, nothing new committed) — the kept folder is deleted afterwards, and VNChess #124 lost two finished fix runs
branch; work the stopped run never committed goes in first as one `wip:` commit, gitignored secrets excluded,
so the next round continues from it — VNChess #144 lost a finished fix at the time limit) — the kept folder is
deleted afterwards, and VNChess #124 lost two finished fix runs
because the follow-up was told not to push. If the follow-up gives no summary either (it timed out, or still no JSON)
but the run was a revision whose pull-request branch head moved since it started, the pushed work carries on to the
checks, review and acceptance with the summary *"The run pushed its work but sent no summary"* and the pull request's
Expand Down
6 changes: 4 additions & 2 deletions src/AgentOs.Modules.Pipeline/Agents/AcceptanceAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,10 @@ 3. Build and run the unit tests the way the repository does (e.g. `dotnet build`
integration test, a data check, a measurement. When a criterion needs the running app, start the
repository's documented local stack in the background (e.g. `dotnet run --project infra/<Name>.AppHost`),
wait until its web endpoint answers, run the relevant end-to-end specs (`npx playwright test <spec>`),
then stop the stack gracefully (Ctrl+C) so it removes its own containers. Never delete Docker volumes,
images or any data outside this directory.
then stop the stack gracefully (Ctrl+C) so it removes its own containers. Docker runs on this computer and
the app host starts its own containers: never run the `docker` CLI (it is refused here) and never conclude
from that refusal that the app can't start. Never delete Docker volumes, images or any data outside this
directory.
5. A criterion this computer cannot check — it needs Docker / `docker compose`, a shell script, a data set or
secret that is not available, or an external service — may still be proven by the pull request's CI: run
`gh pr checks {branch}`, open the workflow file (`.github/workflows/*.yml`) of a job that looks relevant and
Expand Down
19 changes: 17 additions & 2 deletions src/AgentOs.Modules.Pipeline/Prompts/IssueWorkPrompt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ You are an AI software engineer with shell access to a developer machine where t
- .NET: `dotnet test`
- Node: `npm test`
Only skip tests if there is no test infrastructure.
Docker runs on this computer: an app host (e.g. `dotnet run --project infra/<Name>.AppHost`) and test
containers start their own containers. Never run the `docker` CLI — it is refused here — and never conclude
from that refusal that the app or the tests can't run.
A run is stopped at its time limit and anything not pushed is lost: commit and push after each working step,
not only at the end.

7. Commit:
git add -A
Expand Down Expand Up @@ -134,6 +139,11 @@ You are an autonomous coding agent (for example claude-code) running directly on

6. Run the test suite if one exists (.NET: `dotnet test`; Node: `npm test`).
Only skip tests if there is no test infrastructure.
Docker runs on this computer: an app host (e.g. `dotnet run --project infra/<Name>.AppHost`) and test
containers start their own containers. Never run the `docker` CLI — it is refused here — and never conclude
from that refusal that the app or the tests can't run.
A run is stopped at its time limit and anything not pushed is lost: commit and push after each working step,
not only at the end.

7. Commit:
git add -A
Expand Down Expand Up @@ -253,12 +263,17 @@ internal static string RecoveryAsk(IssueWorkRequest req, WorkRepo repo)
return string.Format(
CultureInfo.InvariantCulture,
"""
Your previous run on {0}/{1} for ticket #{2} ended before you sent the JSON reply. Do NOT redo or change the
work, and do not commit anything new. Look at what you already did in the checkout you worked in (this
Your previous run on {0}/{1} for ticket #{2} ended before you sent the JSON reply. Do NOT redo, extend or
change the work. Look at what you already did in the checkout you worked in (this
directory; if it holds no checkout, clone https://github.com/{0}/{1}.git . and run git fetch origin {3}):
git branch --show-current
git status -sb
git log --oneline -10
If git status shows changes you never committed (the run was stopped mid-work), commit ALL of them as one
commit, exactly as they are, so the next round continues from them instead of starting over:
git add -A
git commit -m "wip: unfinished work from the stopped run (#{2})"
(.env and other secrets stay out: they are gitignored — never force-add anything.)
If your commits are on {3} but not on origin yet (the branch is missing on origin, or git status shows it
ahead of origin), push that branch now — this machine's checkout is deleted when the run ends, so unpushed
work is lost:
Expand Down
5 changes: 4 additions & 1 deletion tests/AgentOs.Tests/Sessions/ReplyRecoveryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@ public async Task IssueWork_FollowUpPrompt_CarriesOnlyWhatItNeeds()
// Unpushed work is pushed before the checkout is deleted — only the run's own branch, never forced.
followUp.UserPrompt.ShouldContain("git push -u origin issue-102-ai-fix");
followUp.UserPrompt.ShouldContain("never with --force");
followUp.UserPrompt.ShouldContain("do not commit anything new");
// A run stopped mid-work commits what it left uncommitted (VNChess #144 lost a finished fix that way).
followUp.UserPrompt.ShouldContain("git commit -m \"wip: unfinished work from the stopped run (#102)\"");
followUp.UserPrompt.ShouldContain("never force-add");
followUp.UserPrompt.ShouldContain("Do NOT redo, extend or");
followUp.UserPrompt.ShouldContain("the end, no JSON."); // the tail of what it said
followUp.SystemPrompt.ShouldStartWith("You are the Coding Agent of AgentOS.NET");
followUp.SystemPrompt.ShouldContain(UntrustedText.SystemRule);
Expand Down
Loading