Skip to content

Commit d6d6b79

Browse files
authored
Merge branch 'main' into codex/persist-session-preferences
2 parents eb7063a + 2cafbd0 commit d6d6b79

138 files changed

Lines changed: 4150 additions & 2012 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.

‎.github/workflows/clawsweeper-dispatch.yml‎

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,27 @@ jobs:
8181
repositories: clawsweeper
8282
permission-contents: write
8383

84+
- name: Pre-filter ClawSweeper comment
85+
id: comment_filter
86+
if: ${{ github.event_name == 'issue_comment' }}
87+
env:
88+
COMMENT_BODY: ${{ github.event.comment.body }}
89+
run: |
90+
set -euo pipefail
91+
if grep -Eiq '(^|[[:space:]])@(clawsweeper|openclaw-clawsweeper)\b(\[bot\])?|(^|[[:space:]])/(clawsweeper|review|autoclose|auto([[:space:]]+|-)?merge)\b' <<< "$COMMENT_BODY"; then
92+
echo "is_command=true" >> "$GITHUB_OUTPUT"
93+
else
94+
echo "is_command=false" >> "$GITHUB_OUTPUT"
95+
fi
96+
8497
- name: Create target comment token
8598
id: target_token
86-
if: ${{ github.event_name == 'issue_comment' && env.HAS_CLAWSWEEPER_APP_PRIVATE_KEY == 'true' }}
99+
if: >-
100+
${{
101+
github.event_name == 'issue_comment' &&
102+
steps.comment_filter.outputs.is_command == 'true' &&
103+
env.HAS_CLAWSWEEPER_APP_PRIVATE_KEY == 'true'
104+
}}
87105
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
88106
with:
89107
client-id: ${{ env.CLAWSWEEPER_APP_CLIENT_ID }}
@@ -213,7 +231,11 @@ jobs:
213231
fi
214232
215233
- name: Acknowledge and dispatch ClawSweeper comment
216-
if: ${{ github.event_name == 'issue_comment' }}
234+
if: >-
235+
${{
236+
github.event_name == 'issue_comment' &&
237+
steps.comment_filter.outputs.is_command == 'true'
238+
}}
217239
env:
218240
DISPATCH_TOKEN: ${{ steps.token.outputs.token }}
219241
TARGET_TOKEN: ${{ steps.target_token.outputs.token }}
@@ -232,10 +254,6 @@ jobs:
232254
. "$RUNNER_TEMP/github-api-backoff.sh"
233255
body_file="$RUNNER_TEMP/clawsweeper-comment-body.txt"
234256
printf '%s\n' "$COMMENT_BODY" > "$body_file"
235-
if ! grep -Eiq '(^|[[:space:]])@(clawsweeper|openclaw-clawsweeper)\b(\[bot\])?|(^|[[:space:]])/(clawsweeper|review|automerge|autoclose)\b' "$body_file"; then
236-
echo "No ClawSweeper command found in comment."
237-
exit 0
238-
fi
239257
if [ -n "$TARGET_TOKEN" ]; then
240258
err="$(mktemp)"
241259
if GH_TOKEN="$TARGET_TOKEN" gh_api_with_retry -X POST \

‎docs/concepts/agent-runtimes.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ canonical subscription `github-copilot` provider and is **never** selected by
230230
The harness claims its provider, runtime, CLI session key, and auth profile
231231
prefix in `extensions/copilot/doctor-contract-api.ts`, which
232232
`openclaw doctor` auto-loads. For configuration, auth, transcript mirroring,
233-
compaction, the doctor probe surface, and the broader PI vs Codex vs Copilot
234-
SDK decision, see [GitHub Copilot agent runtime](/plugins/copilot).
233+
compaction, the declarative doctor contract, and the broader PI vs Codex vs
234+
Copilot SDK decision, see [GitHub Copilot agent runtime](/plugins/copilot).
235235

236236
## Compatibility contract
237237

‎docs/plugins/copilot.md‎

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,12 @@ For the broader model/provider/runtime split, start with
3333
- A GitHub Copilot subscription that can drive the Copilot CLI (or a
3434
`gitHubToken` env / auth-profile entry for headless / cron runs).
3535
- A writable `copilotHome` directory. The harness defaults to
36-
`~/.openclaw/agents/<agentId>/copilot` for full per-agent isolation. The
37-
platform default (`%APPDATA%\copilot` on Windows, `$XDG_CONFIG_HOME/copilot`
38-
or `~/.config/copilot` elsewhere) is used as the doctor probe fallback when
39-
no explicit home is set.
36+
`<agentDir>/copilot` when OpenClaw provides an agent directory, otherwise
37+
`~/.openclaw/agents/<agentId>/copilot` for full per-agent isolation.
4038

4139
`openclaw doctor` runs the plugin
42-
[doctor contract](#doctor-and-probes) for the extension; failures there are
43-
the canonical way to confirm the environment is ready before opting an agent
44-
in.
40+
[doctor contract](#doctor) for declarative session-state ownership and future
41+
compatibility migrations. It does not run Copilot CLI environment probes.
4542

4643
## Plugin install
4744

@@ -153,10 +150,6 @@ the same directory), or `~/.openclaw/agents/<agentId>/copilot` otherwise.
153150
Override with `copilotHome: <path>` on the attempt input when you need a
154151
custom location (for example, a shared mount for migration).
155152

156-
`probeCopilotAuthShape` (see [Doctor and probes](#doctor-and-probes)) is the
157-
pure shape check that validates which of the modes above will be used.
158-
It does not perform a live SDK handshake.
159-
160153
## Configuration surface
161154

162155
The harness reads its config from per-attempt input
@@ -239,7 +232,7 @@ asserted in
239232
[`extensions/copilot/harness.test.ts`](https://github.com/openclaw/openclaw/blob/main/extensions/copilot/harness.test.ts)
240233
under `describe("runSideQuestion")`.
241234

242-
## Doctor and probes
235+
## Doctor
243236

244237
`extensions/copilot/doctor-contract-api.ts` is auto-loaded by
245238
`src/plugins/doctor-contract-registry.ts`. It contributes:
@@ -251,18 +244,6 @@ under `describe("runSideQuestion")`.
251244
runtime `copilot`; CLI session key `copilot`; auth profile
252245
prefix `github-copilot:`.
253246

254-
`extensions/copilot/src/doctor-probes.ts` exports three imperative probes
255-
that hosts (including `openclaw doctor`) can call to verify the environment:
256-
257-
| Probe | What it checks | Reasons it can fail |
258-
| -------------------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
259-
| `probeCopilotCliVersion` | `copilot --version` exits 0 with a non-empty version string | `non-zero-exit`, `empty-version`, `spawn-failed`, `spawn-error`, `probe-timeout` |
260-
| `probeCopilotHomeWritable` | `mkdir -p copilotHome` + write + rm a marker file | `copilothome-not-writable` (with the underlying fs error in `details.rawError`) |
261-
| `probeCopilotAuthShape` | At least one of `useLoggedInUser`, `gitHubToken`, or `profileId`+`profileVersion` | `no-auth-source` |
262-
263-
Each probe accepts a DI seam (`spawnFn`, `fsApi`) so tests do not spawn the
264-
real Copilot CLI or touch the host fs.
265-
266247
## Limitations
267248

268249
- The harness only claims the canonical `github-copilot` provider at MVP.

‎extensions/copilot/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on a model or provider entry; `auto` never picks it. PI remains the default
1616
embedded runtime.
1717

1818
See [GitHub Copilot agent runtime](../../docs/plugins/copilot.md) for
19-
configuration, doctor probes, transcript mirroring, compaction, side
19+
configuration, the doctor contract, transcript mirroring, compaction, side
2020
questions, replay, and the supported-surface contract.
2121
See [qa/copilot-capabilities.md](../../qa/copilot-capabilities.md)
2222
for the SDK capability inventory the harness is pinned to.

‎extensions/copilot/doctor-contract-api.ts‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@
1111
* fields exist for copilot yet; the array is empty by design
1212
* and normalizeCompatibilityConfig is a structural no-op so
1313
* future retirements have a stable in-tree home.
14-
*
15-
* The deeper runtime probes (copilot CLI version, copilot auth,
16-
* copilotHome writability) live in {@link ./src/doctor-probes.ts}
17-
* because they have side effects (subprocess spawn, fs touch) and
18-
* need to be invoked imperatively, not declaratively, from the
19-
* doctor command. They are exported separately so callers can opt
20-
* in. Auto-discovery of doctor-contract-api.ts at the plugin root
21-
* keeps this file purely declarative.
2214
*/
2315

2416
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";

0 commit comments

Comments
 (0)