mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 20:40:43 +00:00
ci: harden docs agent fetch retries
This commit is contained in:
27
.github/workflows/docs-agent.yml
vendored
27
.github/workflows/docs-agent.yml
vendored
@@ -55,7 +55,17 @@ jobs:
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git fetch --no-tags origin main
|
||||
for attempt in 1 2 3 4 5; do
|
||||
if git fetch --no-tags origin main; then
|
||||
break
|
||||
fi
|
||||
if [ "$attempt" = "5" ]; then
|
||||
echo "Failed to fetch main after retries." >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Fetch attempt ${attempt} failed; retrying."
|
||||
sleep $((attempt * 2))
|
||||
done
|
||||
remote_main="$(git rev-parse origin/main)"
|
||||
if [ "$remote_main" != "$WORKFLOW_HEAD_SHA" ]; then
|
||||
echo "CI run is superseded by ${remote_main}; skipping docs agent for ${WORKFLOW_HEAD_SHA}."
|
||||
@@ -156,29 +166,26 @@ jobs:
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git fetch --no-tags origin "${TARGET_BRANCH}"
|
||||
remote_main="$(git rev-parse "origin/${TARGET_BRANCH}")"
|
||||
if [ "$remote_main" != "$BASE_SHA" ]; then
|
||||
echo "main advanced from ${BASE_SHA} to ${remote_main}; skipping stale docs update."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git config user.name "openclaw-docs-agent[bot]"
|
||||
git config user.email "openclaw-docs-agent[bot]@users.noreply.github.com"
|
||||
git add docs README.md CHANGELOG.md
|
||||
git commit --no-verify -m "docs: refresh documentation"
|
||||
|
||||
for attempt in 1 2 3 4 5; do
|
||||
if ! git fetch --no-tags origin "${TARGET_BRANCH}"; then
|
||||
echo "Fetch attempt ${attempt} failed; retrying."
|
||||
sleep $((attempt * 2))
|
||||
continue
|
||||
fi
|
||||
if git push "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:"${TARGET_BRANCH}"; then
|
||||
exit 0
|
||||
fi
|
||||
git fetch --no-tags origin "${TARGET_BRANCH}"
|
||||
remote_main="$(git rev-parse "origin/${TARGET_BRANCH}")"
|
||||
if [ "$remote_main" != "$BASE_SHA" ]; then
|
||||
echo "main advanced from ${BASE_SHA} to ${remote_main}; skipping stale docs update."
|
||||
exit 0
|
||||
fi
|
||||
echo "Push attempt ${attempt} failed; retrying."
|
||||
echo "Docs update attempt ${attempt} failed; retrying."
|
||||
sleep $((attempt * 2))
|
||||
done
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
} from "../../routing/session-key.js";
|
||||
import { applyModelOverrideToSessionEntry } from "../../sessions/model-overrides.js";
|
||||
import { normalizeOptionalLowercaseString } from "../../shared/string-coerce.js";
|
||||
import type { BuildStatusTextParams } from "../../status/status-text.js";
|
||||
import type { BuildStatusTextParams } from "../../status/status-text.types.js";
|
||||
import { buildTaskStatusSnapshotForRelatedSessionKeyForOwner } from "../../tasks/task-owner-access.js";
|
||||
import { formatTaskStatusDetail, formatTaskStatusTitle } from "../../tasks/task-status.js";
|
||||
import { loadModelCatalog } from "../model-catalog.js";
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { logVerbose } from "../../globals.js";
|
||||
import { buildStatusText, type BuildStatusTextParams } from "../../status/status-text.js";
|
||||
import { buildStatusText } from "../../status/status-text.js";
|
||||
import type { BuildStatusTextParams } from "../../status/status-text.types.js";
|
||||
import type { ReplyPayload } from "../types.js";
|
||||
import type { CommandContext } from "./commands-types.js";
|
||||
export { buildStatusText } from "../../status/status-text.js";
|
||||
|
||||
@@ -14,21 +14,15 @@ import {
|
||||
} from "../agents/tools/sessions-helpers.js";
|
||||
import { normalizeGroupActivation } from "../auto-reply/group-activation.js";
|
||||
import { resolveSelectedAndActiveModel } from "../auto-reply/model-runtime.js";
|
||||
import type {
|
||||
ElevatedLevel,
|
||||
ReasoningLevel,
|
||||
ThinkLevel,
|
||||
VerboseLevel,
|
||||
} from "../auto-reply/thinking.js";
|
||||
import type { ThinkLevel } from "../auto-reply/thinking.js";
|
||||
import { toAgentModelListLike } from "../config/model-input.js";
|
||||
import type { SessionEntry, SessionScope } from "../config/sessions.js";
|
||||
import type { SessionEntry } from "../config/sessions.js";
|
||||
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import {
|
||||
formatUsageWindowSummary,
|
||||
loadProviderUsageSummary,
|
||||
resolveUsageProviderId,
|
||||
} from "../infra/provider-usage.js";
|
||||
import type { MediaUnderstandingDecision } from "../media-understanding/types.js";
|
||||
import { normalizeOptionalLowercaseString } from "../shared/string-coerce.js";
|
||||
import {
|
||||
listTasksForAgentIdForStatus,
|
||||
@@ -39,35 +33,8 @@ import {
|
||||
formatTaskStatusDetail,
|
||||
formatTaskStatusTitle,
|
||||
} from "../tasks/task-status.js";
|
||||
|
||||
export type BuildStatusTextParams = {
|
||||
cfg: OpenClawConfig;
|
||||
sessionEntry?: SessionEntry;
|
||||
sessionKey: string;
|
||||
parentSessionKey?: string;
|
||||
sessionScope?: SessionScope;
|
||||
storePath?: string;
|
||||
statusChannel: string;
|
||||
provider: string;
|
||||
model: string;
|
||||
contextTokens?: number;
|
||||
resolvedThinkLevel?: ThinkLevel;
|
||||
resolvedFastMode?: boolean;
|
||||
resolvedHarness?: string;
|
||||
resolvedVerboseLevel: VerboseLevel;
|
||||
resolvedReasoningLevel: ReasoningLevel;
|
||||
resolvedElevatedLevel?: ElevatedLevel;
|
||||
resolveDefaultThinkingLevel: () => Promise<ThinkLevel | undefined>;
|
||||
isGroup: boolean;
|
||||
defaultGroupActivation: () => "always" | "mention";
|
||||
mediaDecisions?: MediaUnderstandingDecision[];
|
||||
taskLineOverride?: string;
|
||||
skipDefaultTaskLookup?: boolean;
|
||||
primaryModelLabelOverride?: string;
|
||||
modelAuthOverride?: string;
|
||||
activeModelAuthOverride?: string;
|
||||
includeTranscriptUsage?: boolean;
|
||||
};
|
||||
import type { BuildStatusTextParams } from "./status-text.types.js";
|
||||
export type { BuildStatusTextParams } from "./status-text.types.js";
|
||||
|
||||
const USAGE_OAUTH_ONLY_PROVIDERS = new Set([
|
||||
"anthropic",
|
||||
|
||||
38
src/status/status-text.types.ts
Normal file
38
src/status/status-text.types.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import type {
|
||||
ElevatedLevel,
|
||||
ReasoningLevel,
|
||||
ThinkLevel,
|
||||
VerboseLevel,
|
||||
} from "../auto-reply/thinking.js";
|
||||
import type { SessionEntry, SessionScope } from "../config/sessions.js";
|
||||
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import type { MediaUnderstandingDecision } from "../media-understanding/types.js";
|
||||
|
||||
export type BuildStatusTextParams = {
|
||||
cfg: OpenClawConfig;
|
||||
sessionEntry?: SessionEntry;
|
||||
sessionKey: string;
|
||||
parentSessionKey?: string;
|
||||
sessionScope?: SessionScope;
|
||||
storePath?: string;
|
||||
statusChannel: string;
|
||||
provider: string;
|
||||
model: string;
|
||||
contextTokens?: number;
|
||||
resolvedThinkLevel?: ThinkLevel;
|
||||
resolvedFastMode?: boolean;
|
||||
resolvedHarness?: string;
|
||||
resolvedVerboseLevel: VerboseLevel;
|
||||
resolvedReasoningLevel: ReasoningLevel;
|
||||
resolvedElevatedLevel?: ElevatedLevel;
|
||||
resolveDefaultThinkingLevel: () => Promise<ThinkLevel | undefined>;
|
||||
isGroup: boolean;
|
||||
defaultGroupActivation: () => "always" | "mention";
|
||||
mediaDecisions?: MediaUnderstandingDecision[];
|
||||
taskLineOverride?: string;
|
||||
skipDefaultTaskLookup?: boolean;
|
||||
primaryModelLabelOverride?: string;
|
||||
modelAuthOverride?: string;
|
||||
activeModelAuthOverride?: string;
|
||||
includeTranscriptUsage?: boolean;
|
||||
};
|
||||
Reference in New Issue
Block a user