Skip to content

Commit 5c26758

Browse files
committed
fix: use canonical tool metadata in code mode recovery
2 parents 4248e95 + 2a767ee commit 5c26758

336 files changed

Lines changed: 14927 additions & 4030 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/openclaw-changelog-update/SKILL.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@ every human `Thanks @...` attribution.
173173
its verified user-facing breaking change and migration guidance with the
174174
original PR ref and credit. Keep other internal contributions only in the
175175
complete PR record
176-
- classify internal-only work from conventional prefixes and clear title
177-
signals such as `QA`, `test`, `docs`, `refactor`, `lint`, or `CI`; an
178-
untyped title is not automatically editorial
176+
- classify conventional titles from their declared type and scope, not
177+
incidental words such as `doc` or `build` in their descriptions. For
178+
untyped titles, retain internal-work signals such as `QA`, `test`, `docs`,
179+
`refactor`, `lint`, or `CI`; eligibility never replaces the source audit
180+
that establishes a user-visible outcome
179181
- do not add GHSA references, advisory IDs, or security advisory slugs to
180182
changelog entries or GitHub release-note text unless explicitly requested
181183
- never thank bots, `@claude`, `@codex`, `@openclaw`, `@clawsweeper`, or `@steipete`

‎.agents/skills/openclaw-changelog-update/scripts/verify-release-notes.mjs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,16 +434,16 @@ function githubHandleFromNoreply(email) {
434434
}
435435

436436
function editorialClassification(subject) {
437-
const conventional = subject.match(/^\s*([a-z]+)(?:\([^)]*\))?(!)?:/i);
437+
const conventional = subject.match(/^\s*([a-z]+)(?:\(([^)]*)\))?(!)?:/i);
438438
const type = conventional?.[1]?.toLowerCase();
439439
return {
440-
// A declared breaking API change needs migration notes even when its
441-
// conventional type describes a refactor or other internal work.
440+
// Declared type/scope outrank ambiguous prose such as "doc" or "build".
441+
// Breaking changes still need migration notes even for internal scopes.
442442
editorialEligible:
443-
Boolean(conventional?.[2]) ||
443+
Boolean(conventional?.[3]) ||
444444
((Boolean(type) || editorialTitlePattern.test(subject)) &&
445445
!nonEditorialTypes.has(type) &&
446-
!nonEditorialTitlePattern.test(subject)),
446+
!nonEditorialTitlePattern.test(conventional ? (conventional[2] ?? "") : subject)),
447447
type: type ?? "other",
448448
};
449449
}

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3056,7 +3056,7 @@ jobs:
30563056
name: ${{ matrix.check_name || 'check-shard' }}
30573057
needs: [preflight]
30583058
if: ${{ !cancelled() && always() && needs.preflight.outputs.run_check == 'true' }}
3059-
runs-on: ${{ vars.OPENCLAW_CI_RUNNER_BACKEND == 'github' && 'ubuntu-24.04' || (vars.OPENCLAW_CI_RUNNER_BACKEND == 'hybrid' && github.repository == 'openclaw/openclaw' && github.event_name == 'workflow_dispatch' && !inputs.release_gate && startsWith(inputs.dispatch_id, 'full-release-validation-') && inputs.target_context_ref != '' && needs.preflight.outputs.frozen_target == 'true' && matrix.task == 'lint') && (matrix.runner || 'blacksmith-4vcpu-ubuntu-2404') || (vars.OPENCLAW_CI_RUNNER_BACKEND == 'hybrid' && (github.event_name == 'workflow_dispatch' || github.run_attempt > 1 || (matrix.task != 'lint' && matrix.task != 'test-types' && matrix.task != 'dependencies'))) && 'ubuntu-24.04' || (github.event_name == 'workflow_dispatch' && inputs.release_gate) && 'ubuntu-24.04' || (github.repository == 'openclaw/openclaw' && (github.event_name != 'pull_request' || contains(fromJSON('["OWNER","MEMBER","COLLABORATOR","CONTRIBUTOR"]'), github.event.pull_request.author_association)) && (matrix.runner || 'blacksmith-4vcpu-ubuntu-2404') || 'ubuntu-24.04') }}
3059+
runs-on: ${{ vars.OPENCLAW_CI_RUNNER_BACKEND == 'github' && 'ubuntu-24.04' || (vars.OPENCLAW_CI_RUNNER_BACKEND == 'hybrid' && github.repository == 'openclaw/openclaw' && github.event_name == 'workflow_dispatch' && !inputs.release_gate && startsWith(inputs.dispatch_id, 'full-release-validation-') && needs.preflight.outputs.frozen_target == 'true' && matrix.task == 'lint') && (matrix.runner || 'blacksmith-4vcpu-ubuntu-2404') || (vars.OPENCLAW_CI_RUNNER_BACKEND == 'hybrid' && (github.event_name == 'workflow_dispatch' || github.run_attempt > 1 || (matrix.task != 'lint' && matrix.task != 'test-types' && matrix.task != 'dependencies'))) && 'ubuntu-24.04' || (github.event_name == 'workflow_dispatch' && inputs.release_gate) && 'ubuntu-24.04' || (github.repository == 'openclaw/openclaw' && (github.event_name != 'pull_request' || contains(fromJSON('["OWNER","MEMBER","COLLABORATOR","CONTRIBUTOR"]'), github.event.pull_request.author_association)) && (matrix.runner || 'blacksmith-4vcpu-ubuntu-2404') || 'ubuntu-24.04') }}
30603060
timeout-minutes: 20
30613061
strategy:
30623062
fail-fast: false

‎.github/workflows/docs-agent.yml‎

Lines changed: 122 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ jobs:
4040
persist-credentials: false
4141
submodules: false
4242

43+
- name: Prepare Git owner
44+
uses: openclaw/openclaw/.github/actions/git-owner@dd4528b6393e7d00063067a080ca7241b48ce475
45+
4346
- name: Gate trusted main activity and hourly cadence
4447
id: gate
4548
env:
@@ -49,35 +52,55 @@ jobs:
4952
run: |
5053
set -euo pipefail
5154
52-
if [ "$EVENT_NAME" != "workflow_run" ]; then
53-
head_sha="$(git rev-parse HEAD)"
54-
review_base="$(git rev-parse "${head_sha}^" 2>/dev/null || printf '%s' "$head_sha")"
55-
{
56-
echo "run_agent=true"
57-
echo "base_sha=${head_sha}"
58-
echo "review_base_sha=${review_base}"
59-
echo "review_head_sha=${head_sha}"
60-
} >> "$GITHUB_OUTPUT"
61-
exit 0
62-
fi
55+
remote_main_file="$(mktemp "$RUNNER_TEMP/docs-agent-main.XXXXXX")"
56+
trap 'rm -f -- "$remote_main_file" "$RUNNER_TEMP/docs-agent-runs.json"' EXIT
57+
python3 -I -S "$CI_GIT_OWNER" --policy - "$remote_main_file" <<'PYTHON'
58+
import os
59+
import subprocess
60+
import sys
61+
import tempfile
62+
from ci_git_owner import run_git, git_output, GitFailure, FetchTimeout, backoff, check_cancelled
6363
64-
for attempt in 1 2 3 4 5; do
65-
if timeout --signal=TERM --kill-after=10s 120s git fetch --no-tags origin main; then
66-
break
67-
fi
68-
if [ "$attempt" = "5" ]; then
69-
echo "Failed to fetch main after retries." >&2
70-
exit 1
71-
fi
72-
echo "Fetch attempt ${attempt} failed; retrying."
73-
sleep $((attempt * 2))
74-
done
75-
remote_main="$(git rev-parse origin/main)"
76-
if [ "$remote_main" != "$WORKFLOW_HEAD_SHA" ]; then
77-
echo "CI run is superseded by ${remote_main}; skipping docs agent for ${WORKFLOW_HEAD_SHA}."
78-
echo "run_agent=false" >> "$GITHUB_OUTPUT"
64+
workspace = os.getcwd()
65+
if os.environ["EVENT_NAME"] != "workflow_run":
66+
head_sha = git_output(workspace, "rev-parse", "HEAD").rstrip("\n")
67+
try:
68+
with tempfile.TemporaryFile(dir=os.environ["RUNNER_TEMP"]) as parent:
69+
run_git(workspace, "rev-parse", f"{head_sha}^", stdout=parent, stderr=subprocess.DEVNULL)
70+
parent.seek(0)
71+
review_base = parent.read().decode().rstrip("\n")
72+
except GitFailure:
73+
review_base = head_sha
74+
check_cancelled()
75+
with open(os.environ["GITHUB_OUTPUT"], "a") as output:
76+
output.write(f"run_agent=true\nbase_sha={head_sha}\nreview_base_sha={review_base}\nreview_head_sha={head_sha}\n")
77+
raise SystemExit(0)
78+
79+
for attempt in range(1, 6):
80+
try:
81+
run_git(workspace, "fetch", "--no-tags", "origin", "main", timeout=120, reclaim_locks=True)
82+
break
83+
except (GitFailure, FetchTimeout):
84+
if attempt == 5:
85+
print("Failed to fetch main after retries.", file=sys.stderr)
86+
raise SystemExit(1)
87+
print(f"Fetch attempt {attempt} failed; retrying.", flush=True)
88+
backoff(attempt * 2)
89+
remote_main = git_output(workspace, "rev-parse", "origin/main").rstrip("\n")
90+
check_cancelled()
91+
if remote_main != os.environ["WORKFLOW_HEAD_SHA"]:
92+
print(f"CI run is superseded by {remote_main}; skipping docs agent for {os.environ['WORKFLOW_HEAD_SHA']}.")
93+
with open(os.environ["GITHUB_OUTPUT"], "a") as output:
94+
output.write("run_agent=false\n")
95+
else:
96+
# Only a current, fully drained main read permits the shell cadence query.
97+
with open(sys.argv[3], "w") as fact:
98+
fact.write(remote_main + "\n")
99+
PYTHON
100+
if [ ! -s "$remote_main_file" ]; then
79101
exit 0
80102
fi
103+
remote_main="$(cat "$remote_main_file")"
81104
82105
runs_json="$RUNNER_TEMP/docs-agent-runs.json"
83106
gh api --method GET "repos/${GITHUB_REPOSITORY}/actions/workflows/docs-agent.yml/runs" \
@@ -117,16 +140,31 @@ jobs:
117140
| select(. != $remote_main)
118141
' "$runs_json" | head -n 1
119142
)"
120-
if [ -z "$review_base" ] || ! git cat-file -e "${review_base}^{commit}" 2>/dev/null; then
121-
review_base="$(git rev-parse "${remote_main}^" 2>/dev/null || printf '%s' "$remote_main")"
122-
fi
143+
python3 -I -S "$CI_GIT_OWNER" --policy - "$remote_main" "$review_base" <<'PYTHON'
144+
import os
145+
import subprocess
146+
import sys
147+
import tempfile
148+
from ci_git_owner import run_git, GitFailure, check_cancelled
123149
124-
{
125-
echo "run_agent=true"
126-
echo "base_sha=${remote_main}"
127-
echo "review_base_sha=${review_base}"
128-
echo "review_head_sha=${remote_main}"
129-
} >> "$GITHUB_OUTPUT"
150+
remote_main, review_base = sys.argv[3:]
151+
try:
152+
if review_base:
153+
run_git(os.getcwd(), "cat-file", "-e", f"{review_base}^{{commit}}", stderr=subprocess.DEVNULL)
154+
except GitFailure:
155+
review_base = ""
156+
if not review_base:
157+
try:
158+
with tempfile.TemporaryFile(dir=os.environ["RUNNER_TEMP"]) as parent:
159+
run_git(os.getcwd(), "rev-parse", f"{remote_main}^", stdout=parent, stderr=subprocess.DEVNULL)
160+
parent.seek(0)
161+
review_base = parent.read().decode().rstrip("\n")
162+
except GitFailure:
163+
review_base = remote_main
164+
check_cancelled()
165+
with open(os.environ["GITHUB_OUTPUT"], "a") as output:
166+
output.write(f"run_agent=true\nbase_sha={remote_main}\nreview_base_sha={review_base}\nreview_head_sha={remote_main}\n")
167+
PYTHON
130168
131169
- name: Setup Node environment
132170
if: steps.gate.outputs.run_agent == 'true'
@@ -166,27 +204,30 @@ jobs:
166204
run: |
167205
set -euo pipefail
168206
169-
untracked="$(git ls-files --others --exclude-standard)"
207+
untracked="$(python3 -I -S "$CI_GIT_OWNER" --checkout-git 0 ls-files --others --exclude-standard)"
170208
if [ -n "$untracked" ]; then
171209
echo "Docs agent created untracked files; forbidden:"
172210
printf '%s\n' "$untracked"
173211
exit 1
174212
fi
175213
176-
added_or_deleted="$(git diff --name-status --diff-filter=AD)"
214+
added_or_deleted="$(python3 -I -S "$CI_GIT_OWNER" --checkout-git 0 diff --name-status --diff-filter=AD)"
177215
if [ -n "$added_or_deleted" ]; then
178216
echo "Docs agent added or deleted tracked files; forbidden:"
179217
printf '%s\n' "$added_or_deleted"
180218
exit 1
181219
fi
182220
183-
bad_paths="$(
184-
git diff --name-only | while IFS= read -r path; do
221+
filter_bad_paths() {
222+
while IFS= read -r path; do
185223
case "$path" in
186224
docs/*|README.md|CHANGELOG.md) ;;
187225
*) printf '%s\n' "$path" ;;
188226
esac
189227
done
228+
}
229+
bad_paths="$(
230+
python3 -I -S "$CI_GIT_OWNER" --checkout-git 0 diff --name-only | filter_bad_paths
190231
)"
191232
if [ -n "$bad_paths" ]; then
192233
echo "Docs agent touched non-doc paths; forbidden:"
@@ -218,33 +259,46 @@ jobs:
218259
run: |
219260
set -euo pipefail
220261
221-
if git diff --quiet; then
222-
echo "No docs changes."
223-
exit 0
224-
fi
262+
exec python3 -I -S "$CI_GIT_OWNER" --policy - <<'PYTHON'
263+
import os
264+
import sys
265+
from ci_git_owner import run_git, git_output, GitFailure, FetchTimeout, backoff
266+
267+
workspace = os.getcwd()
268+
target = os.environ["TARGET_BRANCH"]
269+
base_sha = os.environ["BASE_SHA"]
270+
try:
271+
run_git(workspace, "diff", "--quiet")
272+
except GitFailure:
273+
pass
274+
else:
275+
print("No docs changes.")
276+
raise SystemExit(0)
225277
226-
git config user.name "openclaw-docs-agent[bot]"
227-
git config user.email "openclaw-docs-agent[bot]@users.noreply.github.com"
228-
git add docs README.md CHANGELOG.md
229-
git commit --no-verify -m "docs: refresh documentation"
230-
231-
for attempt in 1 2 3 4 5; do
232-
if ! timeout --signal=TERM --kill-after=10s 120s git fetch --no-tags origin "${TARGET_BRANCH}"; then
233-
echo "Fetch attempt ${attempt} failed; retrying."
234-
sleep $((attempt * 2))
235-
continue
236-
fi
237-
if git push "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:"${TARGET_BRANCH}"; then
238-
exit 0
239-
fi
240-
remote_main="$(git rev-parse "origin/${TARGET_BRANCH}")"
241-
if [ "$remote_main" != "$BASE_SHA" ]; then
242-
echo "main advanced from ${BASE_SHA} to ${remote_main}; skipping stale docs update."
243-
exit 0
244-
fi
245-
echo "Docs update attempt ${attempt} failed; retrying."
246-
sleep $((attempt * 2))
247-
done
248-
249-
echo "Failed to push docs updates after retries." >&2
250-
exit 1
278+
run_git(workspace, "config", "user.name", "openclaw-docs-agent[bot]", reclaim_locks=True)
279+
run_git(workspace, "config", "user.email", "openclaw-docs-agent[bot]@users.noreply.github.com", reclaim_locks=True)
280+
run_git(workspace, "add", "docs", "README.md", "CHANGELOG.md", reclaim_locks=True)
281+
run_git(workspace, "commit", "--no-verify", "-m", "docs: refresh documentation", reclaim_locks=True)
282+
for attempt in range(1, 6):
283+
try:
284+
run_git(workspace, "fetch", "--no-tags", "origin", target, timeout=120, reclaim_locks=True)
285+
except (GitFailure, FetchTimeout):
286+
print(f"Fetch attempt {attempt} failed; retrying.", flush=True)
287+
backoff(attempt * 2)
288+
continue
289+
try:
290+
run_git(workspace, "push",
291+
f"https://x-access-token:{os.environ['GITHUB_TOKEN']}@github.com/{os.environ['GITHUB_REPOSITORY']}.git",
292+
f"HEAD:{target}", reclaim_locks=True)
293+
raise SystemExit(0)
294+
except GitFailure:
295+
# A push failure permits stale/retry decisions only after verified cleanup.
296+
remote_main = git_output(workspace, "rev-parse", f"origin/{target}").rstrip("\n")
297+
if remote_main != base_sha:
298+
print(f"main advanced from {base_sha} to {remote_main}; skipping stale docs update.")
299+
raise SystemExit(0)
300+
print(f"Docs update attempt {attempt} failed; retrying.", flush=True)
301+
backoff(attempt * 2)
302+
print("Failed to push docs updates after retries.", file=sys.stderr)
303+
raise SystemExit(1)
304+
PYTHON

‎apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17355,21 +17355,34 @@ public struct LogsTailResult: Codable, Sendable {
1735517355
public let lines: [String]
1735617356
public let truncated: Bool?
1735717357
public let reset: Bool?
17358+
public let skippedbytes: Int?
1735817359

1735917360
public init(
1736017361
file: String,
1736117362
cursor: Int,
1736217363
size: Int,
1736317364
lines: [String],
1736417365
truncated: Bool? = nil,
17365-
reset: Bool? = nil)
17366+
reset: Bool? = nil,
17367+
skippedbytes: Int? = nil)
1736617368
{
1736717369
self.file = file
1736817370
self.cursor = cursor
1736917371
self.size = size
1737017372
self.lines = lines
1737117373
self.truncated = truncated
1737217374
self.reset = reset
17375+
self.skippedbytes = skippedbytes
17376+
}
17377+
17378+
private enum CodingKeys: String, CodingKey {
17379+
case file
17380+
case cursor
17381+
case size
17382+
case lines
17383+
case truncated
17384+
case reset
17385+
case skippedbytes = "skippedBytes"
1737317386
}
1737417387
}
1737517388

0 commit comments

Comments
 (0)