Skip to content

feat: set up OpenClaw MCP and hooks from the agent install command - #8108

Merged
mfbx9da4 merged 25 commits into
mainfrom
cursor/agent-install-openclaw-review-5c3c
Oct 28, 2026
Merged

mfbx9da4 merged 25 commits into
mainfrom
cursor/agent-install-openclaw-review-5c3c

Conversation

@speakeasyforgebot

@speakeasyforgebot speakeasyforgebot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes DNO-1419

Why

Connecting an agent to OpenClaw took manual steps. The Plugins page plugin carries an org hooks key, and a cached sign-in could outrank any key, so sessions were not recorded under the agent.

What changed

Before: the agent install command configured other MCP clients only. OpenClaw needed the gateway added by hand and the plugin downloaded separately.

After: on a machine with openclaw, the same curl … | sh:

  • adds the agent gateway as the speakeasy MCP server, keeping the key out of process arguments;
  • installs the observability plugin with the agent's own key (agent_key: true, mode 600), using --force and --accept-capabilities when the CLI lists them;
  • sets allowConversationAccess, sends one test hook, prints PASS or FAIL, and says to restart the Gateway.

The Manual tab gains an OpenClaw command. The hooks binary now prefers a key marked as an agent's to a cached personal sign-in. An agent with no project gets the gateway only. Hooks from a dashboard-issued key also need #8015, which grants org:hooks_ingest.

Gutternote review steps

  1. Sidebar → Identity → Agents → New (/<org>/projects/<project>/identities/agents/new). Pick a server, then Create agent.
  2. The install step shows the command, a trusted-shell note, and a separate OpenClaw follow-up message with no code or key.
  3. Deny clipboard access. Copy shows Copy failed.
  4. Open Manual. The OpenClaw block runs openclaw mcp add speakeasy with the key from $SPEAKEASY_AGENT_KEY.

Recording

Local stack, OpenClaw 2026.10.6 in Docker: install, chat through the gateway, read the session.

agent-install-openclaw-e2e.mp4

🚀 Preview Environment (PR #8108)

Preview URL: https://pr-8108.dev.getgram.ai

Component Status Details Updated (UTC)
✅ Database Ready Existing database reused 2026-10-28 21:03:01.
✅ Images Available Container images ready 2026-10-28 21:07:01.

Gram Preview Bot

mfbx9da4 and others added 6 commits October 26, 2026 16:34
main reached 52 in #8085, so the manifest change needs its own bump to republish.

Co-authored-by: Forge Bot <speakeasyforgebot@users.noreply.github.com>
It carries the hooks API key, and extraction honors the archive's Unix mode.

Co-authored-by: Forge Bot <speakeasyforgebot@users.noreply.github.com>
- Make the installed speakeasy.json 0600 whatever mode the installer gives it.
- Unpack the archive with python3 when unzip is missing.
- Print a Gateway restart step instead of restarting from inside the turn.
- Say a deleted project, not only a missing one, leaves the agent without hooks.
- Correct the SecretRef note on the MCP header.
- Run the script tests on a stub-only PATH and name the block-reason test for what it checks.

Co-authored-by: Forge Bot <speakeasyforgebot@users.noreply.github.com>
…tall panel

Co-authored-by: Forge Bot <speakeasyforgebot@users.noreply.github.com>
…rom the OpenClaw install

Co-authored-by: Forge Bot <speakeasyforgebot@users.noreply.github.com>
@speakeasyforgebot
speakeasyforgebot requested review from a team as code owners October 26, 2026 17:10
@changeset-bot

changeset-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2bec0c0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
server Minor
dashboard Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@linear-code

linear-code Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

DNO-1419

@github-actions github-actions Bot added the preview Spawn a preview environment label Oct 26, 2026
A plugin's speakeasy.json can now mark its hooks_api_key as an agent's own key (agent_key). The hooks relay and the spool drain then use that key ahead of a cached speakeasy-hooks login, so an agent installed on a machine where a person signed in keeps its events under the agent. SPEAKEASY_AI_HOOKS_API_KEY still wins, and an org key from SPEAKEASY_AI_HOOKS_ORG_KEY is never treated as an agent's. The generator gains GenerateConfig.HooksKeyIsAgent to write the flag; published plugin output is unchanged.

Co-authored-by: Forge Bot <speakeasyforgebot@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 13 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread server/internal/mcp/agentinstall/script.go
Comment thread client/dashboard/src/pages/agents/agent-install-message.ts Outdated
Comment thread server/internal/mcp/agentinstall/script.go Outdated
Comment thread server/internal/mcp/agent_install_internal_test.go
Comment thread server/internal/mcp/agentinstall/script_test.go Outdated
Comment thread server/internal/mcp/agentinstall/script.go
Comment thread client/dashboard/src/pages/agents/AgentGatewayInstall.tsx Outdated
Comment thread docs/runbooks/openclaw-install.md Outdated
Comment thread docs/plugins/package-format.md Outdated
Comment thread client/dashboard/src/pages/agents/AgentGatewayInstall.tsx Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 10 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread docs/runbooks/openclaw-install.md Outdated
Comment thread client/dashboard/src/pages/agents/agent-install-message.test.ts
Comment thread server/internal/mcp/agentinstall/script.go Outdated
Comment thread docs/runbooks/openclaw-install.md Outdated
Comment thread client/dashboard/src/pages/agents/AgentGatewayInstall.tsx
@mfbx9da4
mfbx9da4 changed the base branch from main to cursor/agent-key-outranks-hooks-cache-da9f October 26, 2026 22:37

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 16 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread docs/runbooks/openclaw-install.md Outdated
Comment thread server/internal/mcp/agentinstall/script.go
Comment thread server/internal/mcp/agentinstall/script_test.go
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@github-actions

Copy link
Copy Markdown
Contributor

atlas migrate lint on server/migrations

Status Step Result
No migration files detected  
ERD and visual diff generated View Visualization
No issues found View Report
Read the full linting report on Atlas Cloud

@github-actions

Copy link
Copy Markdown
Contributor

atlas migrate lint on clickhouse/migrations

Status Step Result
No migration files detected  
ERD and visual diff generated View Visualization
No issues found View Report
Read the full linting report on Atlas Cloud

@mfbx9da4
mfbx9da4 changed the base branch from cursor/agent-key-outranks-hooks-cache-da9f to main October 28, 2026 17:00
Comment thread .changeset/agent-hook-credential-order.md Outdated
@blacksmith-sh

blacksmith-sh Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
tests/
wake-stack.spec.ts:123:1 › a paused worktree serves the resume page and comes back from
it › the page reloads into the dashboard
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@mfbx9da4 mfbx9da4 added the review:bypass Merge without human review approval. Required status checks still apply. label Oct 28, 2026
@mfbx9da4
mfbx9da4 enabled auto-merge October 28, 2026 17:38

@gram-bot gram-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved: review:bypass label applied by @mfbx9da4. Required status checks still gate this merge.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found and verified against the latest diff

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/runbooks/hooks-environment-overrides.md">

<violation number="1" location="docs/runbooks/hooks-environment-overrides.md:72">
P2: This overstates the override for replay: `SPEAKEASY_AI_HOOKS_ORG_KEY` only replaces the baked key and clears `agent_key` on drain when the spooled deployment matches. Scope the sentence to match the code.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread client/dashboard/src/pages/agents/credentials/StepInstall.tsx Outdated
Comment thread hooks/relay/drain.go
Comment thread hooks/relay/runner.go
Comment thread docs/runbooks/hooks-environment-overrides.md Outdated
Comment thread server/internal/plugins/impl.go
Comment thread hooks/relay/relay_test.go
Comment thread hooks/relay/runner.go

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread server/internal/plugins/generate.go
Comment thread server/internal/plugins/impl.go
Comment thread hooks/relay/drain_test.go
Comment thread hooks/relay/config.go

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 28 files

Requires human review: Auto-approval blocked because this review re-detected 5 unresolved issues already reported by Cubic.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread hooks/relay/auth.go
Comment thread hooks/relay/provision.go Outdated
Apply SPEAKEASY_AI_HOOKS_ORG_KEY on replay only when the environment names the
entry's server, skip the Claude sign-in nudge for agent plugins, let an
explicit login see an existing cached sign-in, and let WritePlugin mark an
agent key. Tests clear the org key and deployment env vars.
Write the gateway entry through a private batch file and openclaw config
set --batch-file, as the one-line setup does, then make the saved config
owner-only.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 15 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread hooks/relay/relay_test.go
Comment thread client/dashboard/src/pages/agents/credentials/StepInstall.tsx Outdated
Comment thread hooks/relay/relay_test.go
@mfbx9da4
mfbx9da4 added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 9701990 Oct 28, 2026
59 of 60 checks passed
@mfbx9da4
mfbx9da4 deleted the cursor/agent-install-openclaw-review-5c3c branch October 28, 2026 21:29
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

preview Spawn a preview environment review:bypass Merge without human review approval. Required status checks still apply.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants