Agent Skillshappier-dev/happier › happier-session-control

happier-session-control

GitHub

通过CLI JSON模式管理Happier会话,支持独立诊断会话的创建、所有权控制及监控。

skills/happier-session-control/SKILL.md happier-dev/happier

Trigger Scenarios

用户请求创建新的诊断会话 需要独立会话进行故障排查或分析

Install

npx skills add happier-dev/happier --skill happier-session-control -g -y
More Options

Use without installing

npx skills use happier-dev/happier@happier-session-control

指定 Agent (Claude Code)

npx skills add happier-dev/happier --skill happier-session-control -a claude-code -g -y

安装 repo 全部 skill

npx skills add happier-dev/happier --all -g -y

预览 repo 内 skill

npx skills add happier-dev/happier --list

SKILL.md

Frontmatter
{
    "name": "happier-session-control",
    "metadata": {
        "openclaw": {
            "homepage": "https:\/\/github.com\/happier-dev\/happier",
            "requires": {
                "bins": [
                    "happier"
                ]
            }
        }
    },
    "description": "Manage Happier sessions and execution runs through the CLI JSON contract, and create independent Happier diagnosis sessions with explicit ownership, safe options, and fire-and-forget presentation semantics."
}

Happier Session Control (CLI JSON)

This skill enables an agent framework (for example OpenClaw) to control Happier sessions using the existing happier CLI in --json mode.

Prerequisites

  • The happier CLI is installed and authenticated.
  • If using multiple servers/profiles, pass server selection flags before session (prefix-only):
    • happier --server <profile-id-or-name> session list --json
    • happier --server-url <url> --webapp-url <url> session list --json

Contract

All JSON outputs are a pure-stdout envelope:

{ "v": 1, "ok": true, "kind": "...", "data": {} }

or:

{ "v": 1, "ok": false, "kind": "...", "error": { "code": "..." } }

Common error codes to handle:

  • not_authenticated: run happier auth login on the host (or mount/provide a valid HAPPIER_HOME_DIR).
  • session_id_ambiguous: pick deterministically from error.candidates (prefer exact id; otherwise ask the user).
  • session_not_found: call happier session list --json and retry.
  • unsupported: feature disabled by server policy or backend doesn’t support the requested intent.

Independent session delegation

Use an independent Happier session only when the user asks for new sessions or when an invoking workflow explicitly selects that topology. Native subagents remain the owner for in-session delegation.

When an independent session owns a complete work bundle:

  • create it with a self-contained initialMessage, descriptive title and tag, the intended repository path, and only user-selected or safely resolved machine/profile/backend/model options;
  • use canonical read-only permission mode for diagnosis when the selected backend supports it, plus an explicit no-write constraint in the brief. Permission modes are backend-applied policy, not a universal security sandbox; do not overclaim enforcement;
  • treat a successful accepted spawn as the triage lane's completion for that bundle;
  • return the new session id/title and allocation to the user, then stop by default;
  • let the spawned session present its diagnosis directly to the user;
  • do not wait for idle or pull its transcript merely to re-present the same result;
  • do not instruct the spawned session to create further independent sessions unless the user explicitly requested recursive orchestration.

Use monitoring only when the user asks the parent to supervise, consolidate, or continue after the child. In that case, session.wait.idle, session.transcript.get, and session.message.send are optional follow-up tools, not part of the default spawn flow.

The Happier MCP action ids are:

  • session.spawn_new — accepts initialMessage, title, tag, path, machineId, profileId, backend/model selection, and permissionMode;
  • session.wait.idle — optional monitoring;
  • session.transcript.get — optional transcript retrieval;
  • session.message.send — optional follow-up or correction.

The MCP binding names are session_spawn_new, session_wait_idle, session_transcript_get, and session_message_send. When actions are unavailable, use the corresponding CLI JSON commands below where the needed options are supported, or report the missing capability instead of silently changing topology.

Auth Commands (JSON)

Check auth status without scraping human output:

happier auth status --json

Session Commands

List sessions:

happier session list --json

Inspect session status (server snapshot):

happier session status <session-id-or-prefix> --json

Inspect session status with a best-effort live refresh:

happier session status <session-id-or-prefix> --live --json

Create/load a session by tag:

happier session create --tag <tag> --json

Send a message to a session:

happier session send <session-id-or-prefix> "<message>" --json

Send a message and wait until the session is idle:

happier session send <session-id-or-prefix> "<message>" --wait --timeout 300 --json

Wait for a session to become idle:

happier session wait <session-id-or-prefix> --timeout 300 --json

Stop a session:

happier session stop <session-id-or-prefix> --json

Read session history (compact is recommended for prompt stuffing):

happier session history <session-id-or-prefix> --limit 50 --format compact --json

Execution Run Commands

Start an execution run:

happier session run start <session-id-or-prefix> --intent review --backend claude --json

List runs for a session:

happier session run list <session-id-or-prefix> --json

Get a run:

happier session run get <session-id-or-prefix> <run-id> --include-structured --json

Send input to a run:

happier session run send <session-id-or-prefix> <run-id> "<message>" --json

Stop a run:

happier session run stop <session-id-or-prefix> <run-id> --json

Execute an action on a run:

happier session run action <session-id-or-prefix> <run-id> <action-id> --input-json '<json>' --json

Wait for a run to finish:

happier session run wait <session-id-or-prefix> <run-id> --timeout 300 --json

Stream turn IO for a streaming run (e.g. intent=voice_agent):

happier session run stream-start <session-id-or-prefix> <run-id> "<message>" --json
happier session run stream-read <session-id-or-prefix> <run-id> <stream-id> --cursor 0 --json
happier session run stream-cancel <session-id-or-prefix> <run-id> <stream-id> --json

Server Commands (JSON)

List server profiles:

happier server list --json

Current active server:

happier server current --json

Add a server profile non-interactively:

happier server add --name "My Server" --server-url https://example.com --webapp-url https://example.com --use --json

Switch active server:

happier server use <id-or-name> --json

Remove a server profile:

happier server remove <id-or-name> --force --json

Probe server reachability/version:

happier server test [<id-or-name>] --json

Set a one-off custom server as active:

happier server set --server-url https://example.com --webapp-url https://example.com --json

Version History

  • 98c86f2 Current 2026-08-20 01:01

    重构证据路由与诊断分离,新增只读技能处理多问题归一化、深度诊断及不可信输入处理,约束GitHub工作流上下文传输。

  • 4766022 2026-07-25 07:09

Same Skill Collection

openclaw/happier-session-control/skills/happier-session-control/SKILL.md
skills/attack-conclusion/SKILL.md
skills/decompose-gates/SKILL.md
skills/handoff-report/SKILL.md
skills/happier-compatibility/SKILL.md
skills/happier-diagnose/SKILL.md
skills/happier-docs/SKILL.md
skills/happier-github-ops/SKILL.md
skills/happier-implement-plan/SKILL.md
skills/happier-implement/SKILL.md
skills/happier-issue-diagnose/SKILL.md
skills/happier-issue-triage/SKILL.md
skills/happier-plan/SKILL.md
skills/happier-release-notes/SKILL.md
skills/happier-release-promote/SKILL.md
skills/happier-release-validation-review/SKILL.md
skills/happier-release-validation/SKILL.md
skills/happier-release/SKILL.md
skills/happier-testing/SKILL.md
skills/verify-claims/SKILL.md
skills/happier-commit-worktree/SKILL.md
skills/happier-profile-and-optimize/SKILL.md
skills/happier-review/SKILL.md

Metadata

Files
0
Version
98c86f2
Hash
30cbaeeb
Indexed
2026-07-25 07:09

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 12:26
浙ICP备14020137号-1 $방문자$