Both silent-failure paths live in .gitea/workflows/scripts/publish.sh, in the dev-agent
PR-open path near the end of the file:
PR-create failure is swallowed. After the curl -X POST "$API/pulls" call, if it fails
(url stays empty), the script does this:
[ -z "$url"]&&{echo"PR open/lookup failed for $br — posting reply on issue instead"; post "$(printf'%s%s'"$reply""$activity")";exit 0;}
The echo only reaches the Actions run log. The comment posted to the issue is the agent's
normal reply with no mention that a PR should exist, no branch name, no HTTP status, no
error body. This is the exact scenario in #111 — ai/issue-12 had a real commit pushed but no
PR, and nothing in the issue said why.
git push failure is discarded outright, not just under-reported:
git push origin "HEAD:$BRANCH"||true
If the push fails, ahead (computed later from origin/main..origin/$br) can read 0, and
the script takes the "no changes — plan only" branch, actively misreporting a push failure as
"nothing to do."
Requested fix
On PR-create failure: capture the HTTP status and Gitea's .message from the response, and
post a distinct ⚠️ comment on the issue naming the branch and the error — not the agent's
plain reply.
On git push failure: don't swallow with || true — detect it and post a similarly loud
comment instead of falling through to the "no changes" path.
Keep the rest of the control flow (the post / prpost / trig helpers, the 🤖 loop-guard
marker) untouched — this is a narrow fix to the two error paths above.
Follow-up to #111 with the exact fix location.
## Root cause
Both silent-failure paths live in `.gitea/workflows/scripts/publish.sh`, in the dev-agent
PR-open path near the end of the file:
1. **PR-create failure is swallowed.** After the `curl -X POST "$API/pulls"` call, if it fails
(`url` stays empty), the script does this:
```sh
[ -z "$url" ] && { echo "PR open/lookup failed for $br — posting reply on issue instead"; post "$(printf '%s%s' "$reply" "$activity")"; exit 0; }
```
The `echo` only reaches the Actions run log. The comment posted to the issue is the agent's
normal reply with **no mention that a PR should exist**, no branch name, no HTTP status, no
error body. This is the exact scenario in #111 — `ai/issue-12` had a real commit pushed but no
PR, and nothing in the issue said why.
2. **`git push` failure is discarded outright**, not just under-reported:
```sh
git push origin "HEAD:$BRANCH" || true
```
If the push fails, `ahead` (computed later from `origin/main..origin/$br`) can read `0`, and
the script takes the "no changes — plan only" branch, actively misreporting a push failure as
"nothing to do."
## Requested fix
- On PR-create failure: capture the HTTP status and Gitea's `.message` from the response, and
post a distinct `⚠️` comment on the issue naming the branch and the error — not the agent's
plain reply.
- On `git push` failure: don't swallow with `|| true` — detect it and post a similarly loud
comment instead of falling through to the "no changes" path.
Keep the rest of the control flow (the `post` / `prpost` / `trig` helpers, the `🤖` loop-guard
marker) untouched — this is a narrow fix to the two error paths above.
Plan for #112 — narrow fix to two silent-failure paths in .gitea/workflows/scripts/publish.sh.
Scope (one file, two locations):
PR-create failure (the [ -z "$url" ] && ... block): replace the silent echo with captured HTTP status + Gitea's .message from the curl response, then post a distinct ⚠️ comment naming the branch and the error — instead of the agent's plain reply.
git push failure (the git push origin "HEAD:$BRANCH" || true line): drop the || true, detect non-zero exit, and post a similarly loud ⚠️ comment instead of falling through to the "no changes" branch.
Untouched: the post / prpost / trig helpers, the 🤖 loop-guard marker, and the fix-attempt trigger template+regex (the latter must stay pinned together per the learnings, but neither error path we're editing touches that template).
Who: @junior. Single-file, well-scoped, shell error-handling fix. No agent additions, no heredoc edits, no trigger-gate changes — the agent-addition learnings don't apply. Script is critical but the diff is narrow and isolated to two known blocks.
@ffaerber ready to start building? reply yes to proceed.
details
🔧 0 tool calls · in 10332 · out 1994 tokens · subscription · model ollama-cloud/minimax-m3:cloud
Plan for #112 — narrow fix to two silent-failure paths in `.gitea/workflows/scripts/publish.sh`.
**Scope (one file, two locations):**
1. **PR-create failure** (the `[ -z "$url" ] && ...` block): replace the silent `echo` with captured HTTP status + Gitea's `.message` from the curl response, then post a distinct `⚠️` comment naming the branch and the error — instead of the agent's plain reply.
2. **`git push` failure** (the `git push origin "HEAD:$BRANCH" || true` line): drop the `|| true`, detect non-zero exit, and post a similarly loud `⚠️` comment instead of falling through to the "no changes" branch.
**Untouched:** the `post` / `prpost` / `trig` helpers, the `🤖` loop-guard marker, and the fix-attempt trigger template+regex (the latter must stay pinned together per the learnings, but neither error path we're editing touches that template).
**Who:** @junior. Single-file, well-scoped, shell error-handling fix. No agent additions, no heredoc edits, no trigger-gate changes — the agent-addition learnings don't apply. Script is critical but the diff is narrow and isolated to two known blocks.
@ffaerber ready to start building? reply yes to proceed.
<details>
<summary>details</summary>
🔧 0 tool calls · in 10332 · out 1994 tokens · subscription · model ollama-cloud/minimax-m3:cloud
_(no tool calls — text-only reply)_
<sub>tokens — input 10332 (fresh 10332 · cache 0w / 0r) · output 1994 · reasoning 0 · **subscription**</sub>
</details>
<!-- 🤖 agent reply — do not trigger -->
🔨 Building on branch ai/issue-112 — I'll open a PR when it's ready.
🔨 Building on branch [`ai/issue-112`](https://git.ffaerber.duckdns.org/gitea/agents/src/branch/ai/issue-112) — I'll open a PR when it's ready.
<!-- 🤖 agent reply — do not trigger -->
Acknowledged — handing PR #113 to @qa for review against the plan in this thread (two narrow edits in .gitea/workflows/scripts/publish.sh: PR-create failure gets a loud ⚠️ comment with status + .message; git push failure stops being swallowed and also gets a loud ⚠️ instead of falling through to the "no changes" path). Helpers / loop-guard / fix-attempt template+regex must stay untouched.
details
🔧 0 tool calls · in 10944 · out 270 tokens · subscription · model ollama-cloud/minimax-m3:cloud
Acknowledged — handing PR #113 to @qa for review against the plan in this thread (two narrow edits in `.gitea/workflows/scripts/publish.sh`: PR-create failure gets a loud `⚠️` comment with status + `.message`; `git push` failure stops being swallowed and also gets a loud `⚠️` instead of falling through to the "no changes" path). Helpers / loop-guard / fix-attempt template+regex must stay untouched.
<details>
<summary>details</summary>
🔧 0 tool calls · in 10944 · out 270 tokens · subscription · model ollama-cloud/minimax-m3:cloud
_(no tool calls — text-only reply)_
<sub>tokens — input 10944 (fresh 10944 · cache 0w / 0r) · output 270 · reasoning 0 · **subscription**</sub>
</details>
<!-- 🤖 agent reply — do not trigger -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Follow-up to #111 with the exact fix location.
Root cause
Both silent-failure paths live in
.gitea/workflows/scripts/publish.sh, in the dev-agentPR-open path near the end of the file:
PR-create failure is swallowed. After the
curl -X POST "$API/pulls"call, if it fails(
urlstays empty), the script does this:The
echoonly reaches the Actions run log. The comment posted to the issue is the agent'snormal reply with no mention that a PR should exist, no branch name, no HTTP status, no
error body. This is the exact scenario in #111 —
ai/issue-12had a real commit pushed but noPR, and nothing in the issue said why.
git pushfailure is discarded outright, not just under-reported:If the push fails,
ahead(computed later fromorigin/main..origin/$br) can read0, andthe script takes the "no changes — plan only" branch, actively misreporting a push failure as
"nothing to do."
Requested fix
.messagefrom the response, andpost a distinct
⚠️comment on the issue naming the branch and the error — not the agent'splain reply.
git pushfailure: don't swallow with|| true— detect it and post a similarly loudcomment instead of falling through to the "no changes" path.
Keep the rest of the control flow (the
post/prpost/trighelpers, the🤖loop-guardmarker) untouched — this is a narrow fix to the two error paths above.
Plan for #112 — narrow fix to two silent-failure paths in
.gitea/workflows/scripts/publish.sh.Scope (one file, two locations):
[ -z "$url" ] && ...block): replace the silentechowith captured HTTP status + Gitea's.messagefrom the curl response, then post a distinct⚠️comment naming the branch and the error — instead of the agent's plain reply.git pushfailure (thegit push origin "HEAD:$BRANCH" || trueline): drop the|| true, detect non-zero exit, and post a similarly loud⚠️comment instead of falling through to the "no changes" branch.Untouched: the
post/prpost/trighelpers, the🤖loop-guard marker, and the fix-attempt trigger template+regex (the latter must stay pinned together per the learnings, but neither error path we're editing touches that template).Who: @junior. Single-file, well-scoped, shell error-handling fix. No agent additions, no heredoc edits, no trigger-gate changes — the agent-addition learnings don't apply. Script is critical but the diff is narrow and isolated to two known blocks.
@ffaerber ready to start building? reply yes to proceed.
details
🔧 0 tool calls · in 10332 · out 1994 tokens · subscription · model ollama-cloud/minimax-m3:cloud
(no tool calls — text-only reply)
tokens — input 10332 (fresh 10332 · cache 0w / 0r) · output 1994 · reasoning 0 · subscription
@pm yes, go ahead.
Handing off to @junior.
details
🔧 0 tool calls · in 10735 · out 88 tokens · subscription · model ollama-cloud/minimax-m3:cloud
(no tool calls — text-only reply)
tokens — input 10735 (fresh 10735 · cache 0w / 0r) · output 88 · reasoning 0 · subscription
@junior please proceed with issue #112 per my plan above.
🔨 Building on branch
ai/issue-112— I'll open a PR when it's ready.@pm — PR #113 is ready for review (issue #112).
Acknowledged — handing PR #113 to @qa for review against the plan in this thread (two narrow edits in
.gitea/workflows/scripts/publish.sh: PR-create failure gets a loud⚠️comment with status +.message;git pushfailure stops being swallowed and also gets a loud⚠️instead of falling through to the "no changes" path). Helpers / loop-guard / fix-attempt template+regex must stay untouched.details
🔧 0 tool calls · in 10944 · out 270 tokens · subscription · model ollama-cloud/minimax-m3:cloud
(no tool calls — text-only reply)
tokens — input 10944 (fresh 10944 · cache 0w / 0r) · output 270 · reasoning 0 · subscription
@qa please review PR #113 for issue #112 — put your recommendations on the PR, or approve.
✅ Reviewed PR #113 — looks good.
@pm — I have reviewed and approved PR #113 (issue #112). Over to you.
PR #113 is reviewed and ready to merge, @ffaerber.
details
🔧 0 tool calls · in 0 · out 211 tokens · subscription · model ollama-cloud/minimax-m3:cloud
(no tool calls — text-only reply)
tokens — input 0 (fresh 0 · cache 0w / 0r) · output 211 · reasoning 0 · subscription