Skip to content

feat(cli): recall + personality commands and Hermes-style slash commands - #12

Merged
mayoalexander merged 1 commit into
mainfrom
feat/recall-personality-slash-commands
May 3, 2026
Merged

feat(cli): recall + personality commands and Hermes-style slash commands#12
mayoalexander merged 1 commit into
mainfrom
feat/recall-personality-slash-commands

Conversation

@mayoalexander

Copy link
Copy Markdown

Summary

Surfaces two new platform endpoints in the CLI plus four Hermes-style in-chat slash commands. ~10% of the work is in iris-code (this PR) — the heavy lifting is in fl-api / fl-iris-api (already merged).

Shell commands

  • iris recall <query> [--days N] [--agent ID] [--limit N] [--no-summarize] — cross-source memory + chat + diary search with gpt-5-nano summary
  • iris personality {list | show <key> | apply <agentId> <key>} — 6 seeded preset library; apply writes to bloq_agents.personality_traits

TUI slash commands

  • /recall, /personality, /usage, /insights, /sdk — appear in autocomplete; insert templated prompt; agent handles via sdk:call (taught in scaffold/AGENTS.md)

SDK registry (sdk:call)

  • recall.search, personalities.list, personalities.get, personalities.apply
  • New base: "fl" | "iris" field on RouteDescriptor so cross-API endpoints route correctly

Backed by (already merged)

Test plan

  • Backend endpoints: 16/16 feature tests passing locally
  • iris-code typecheck clean
  • Smoke test once binary released: iris recall "test", iris personality list, iris personality apply <id> concise

Notes

  • scaffold/AGENTS.md updated to teach the agent how to interpret in-chat slashes — propagates to users on next install/upgrade
  • Layering: this PR keeps iris-code thin; logic lives in fl-api/iris-api per project convention

🤖 Generated with Claude Code

…ommands

Surfaces two new platform endpoints in the CLI:

- iris recall <query> [--days N] [--agent ID] [--limit N] [--no-summarize]
  Wraps GET /api/v6/recall on iris-api. Cross-source search across memory +
  chat history + diary, with gpt-5-nano summarization.

- iris personality {list|show <key>|apply <agentId> <key>|--traits "..."}
  Wraps fl-api /v1/personalities + apply endpoint. 6 seeded presets
  (concise, formal, casual, technical, coach, analyst).

TUI autocomplete additions for in-chat use:
  /recall, /personality, /usage, /insights, /sdk

SDK registry (sdk:call --list) gains:
  recall.search, personalities.list, personalities.get, personalities.apply

Adds optional `base: "fl" | "iris"` field on RouteDescriptor so cross-API
endpoints route correctly (recall hits IRIS_API, personalities hit FL_API).

scaffold/AGENTS.md teaches the agent how to interpret in-chat slash commands
via sdk:call. Will sync to FREELABEL/iris-opencode on next scaffold release.

Backed by:
- fl-api PR (merged): personality endpoint
- fl-iris-api PR #22 (merged): recall endpoint

Typecheck clean. Both backend endpoints have 8/8 feature tests passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 3, 2026 19:39
@mayoalexander
mayoalexander merged commit 6b3c0de into main May 3, 2026
1 of 3 checks passed
@mayoalexander
mayoalexander deleted the feat/recall-personality-slash-commands branch May 3, 2026 19:39
mayoalexander added a commit that referenced this pull request May 3, 2026
Releases recall + personality CLI commands and Hermes-style slash
commands (/recall, /personality, /usage, /insights, /sdk).

See PR #12 for full changelog.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds CLI and TUI affordances for cross-source “recall” search and agent personality presets, plus registers new SDK routes so sdk:call can reach both fl-api and iris-api endpoints.

Changes:

  • Introduces new CLI commands: iris recall and iris personality {list|show|apply}.
  • Adds Hermes-style slash commands to TUI autocomplete (/recall, /personality, /usage, /insights, /sdk).
  • Extends iris sdk:call route descriptors with a base selector and registers recall.search + personalities.* endpoints.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
scaffold/AGENTS.md Documents new in-chat slash commands and recommended handling via CLI/sdk:call.
packages/opencode/src/index.ts Registers the new recall and personality commands in the CLI.
packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx Adds new slash commands to autocomplete and inserts templated slash text on select.
packages/opencode/src/cli/cmd/platform-sdk-call.ts Adds base: "fl" | "iris" routing and registers new recall/personality endpoints.
packages/opencode/src/cli/cmd/platform-recall.ts Implements iris recall command calling /api/v6/recall on iris-api.
packages/opencode/src/cli/cmd/platform-personality.ts Implements iris personality subcommands (list/show/apply) against fl-api.
packages/opencode/src/cli/cmd/command-groups.ts Categorizes personality and recall in grouped help output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scaffold/AGENTS.md
Comment on lines +66 to +67
| `/recall <query>` | Search past sessions, memory, and diary for the query | Use `iris sdk:call diary.list` and `iris memory show <bloq>` to gather context, then summarize matches. If no specific bloq is set, search across the user's recent diary entries. |
| `/personality [name]` | View or switch the active agent's personality | No name → list available agents with their `personality_traits` via `iris sdk:call agents.list userId=me`. With a name → find a matching agent or update the active agent's `personality_traits` field via `iris agents push` after pulling. |
Comment on lines +314 to +318
const apiBase = route.base === "iris" ? IRIS_API : FL_API
const res = await irisFetch(finalUrl, {
method: route.method,
...(body ? { body } : {}),
})
}, apiBase)
// Personality presets (fl-api)
"personalities.list": { method: "GET", path: "/api/v1/personalities" },
"personalities.get": { method: "GET", path: "/api/v1/personalities/{key}" },
"personalities.apply": { method: "POST", path: "/api/v1/users/{userId}/bloqs/agents/{agent}/apply-personality", needsUserId: true },
})

export const PlatformPersonalityCommand = cmd({
command: "personality <command>",
Comment on lines +377 to +383
const insertSlash = (name: string) => () => {
const newText = "/" + name + " "
const cursor = props.input().logicalCursor
props.input().deleteRange(0, 0, cursor.row, cursor.col)
props.input().insertText(newText)
props.input().cursorOffset = Bun.stringWidth(newText)
}
mayoalexander added a commit that referenced this pull request Aug 19, 2026
…ed on a 404

`iris integrations list` collapsed every probe failure into "unverified — could
not probe", which tells the reader nothing and cost real debugging hours.

Two worse bugs surfaced while fixing that:

1. The gmail and google-drive probes returned "verified" for ANY response that
   was not 401/403 — including 404 and 500. Both probe endpoints currently 404
   (/api/v1/leads/0/gmail-threads, /api/v1/integrations/exec), so Gmail has been
   rendering a green [verified] while its probe does not resolve at all. The
   health signal on those rows was meaningless.

2. Probe results were keyed by integration TYPE, not id, and the drive probe
   never passed integration_id. All three google-drive accounts (#4, #11, #12)
   therefore shared one result taken from whichever connection the API picks by
   default — two accounts could be dead and every row would show the third's
   status. The comment directly above that code says multi-account visibility is
   the point of the command.

Changes:

- Probes return { state, reason, fix } instead of a bare string, so every row
  states its cause and, where one exists, the command that fixes it.
- New "unknown" state, distinct from failure. A 404 on the PROBE path means we
  cannot determine the integration's health; claiming either verified or
  unverified would be unsupported. Rendered neutral rather than red, because the
  fix belongs to us, not the user.
- Network failures are classified — connection refused / timeout / DNS — rather
  than collapsing into one string.
- Results keyed by integration id; the drive probe passes integration_id so each
  account is genuinely probed.
- The calendar probe distinguishes bridge-not-running, no-bridge-key,
  key-rejected and HTTP-n, each with `iris hive doctor` as the fix.

    before  gmail #3            [verified]
    after   gmail #3            [unknown] — probe endpoint returned 404; status not determined
    before  google-calendar #2  [unverified] — could not probe
    after   google-calendar #2  [unverified] — no bridge key configured → iris hive doctor

Verified by running the command from source, not by reading the diff. Typecheck
clean; the remaining tsc error (session/llm.ts:88 TS2589) is pre-existing and
reproduces with this change stashed.

Refs #180929, #181016

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mayoalexander added a commit that referenced this pull request Aug 27, 2026
…sktop sidecar (#58)

* fix(integrations): address low-severity bugs #12, #16, #17

- #12: replace btoa with secure random nonce in WhatsApp OAuth state
- #16: stop swallowing network errors in resolveAccountToIntegrationId
- #17: read COMPOSIO_API_KEY at call-time instead of module load

* fix(desktop): resolve iris-cli sidecar via Tauri API (fix 'Failed to spawn IRIS Server')

* fix(stats): add --json output for machine-readable usage stats (bug #5)

stats emitted ASCII boxes with no --json option; scripts parsing
`iris stats --json` got non-JSON. Build structured JSON via writeJson,
reusing the existing aggregateSessionStats payload plus admin-derived
metrics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants