Add ability to inspect staging and production AI rooms with the inspect-ai-room skill - #5922
Add ability to inspect staging and production AI rooms with the inspect-ai-room skill#5922jurgenwerk wants to merge 3 commits into
Conversation
…file token Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0353bfefa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let profiles = JSON.parse(fs.readFileSync(file, 'utf8')).profiles ?? {}; | ||
| let p = | ||
| profiles[idOrHint] ?? | ||
| Object.values(profiles).find((x) => x.matrixUrl?.includes(idOrHint)); |
There was a problem hiding this comment.
Reject ambiguous profile URL hints
When profiles.json contains multiple accounts for the same environment, the documented --profile staging or --profile boxel.ai shorthand silently selects the first matching profile. If the requested room belongs to another matching account, every command fails with a Matrix authorization error even though a suitable profile exists; detect multiple matches and require an exact profile ID rather than depending on object insertion order.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
[Claude Code 🤖] (Written by Claude on Matic's behalf.) Fixed: a hint that matches more than one profile now throws and lists the matching ids, so the caller must pass the exact profile id.
There was a problem hiding this comment.
Pull request overview
This PR extends the inspect-ai-room skill so it can inspect AI assistant Matrix rooms in staging/production by reusing a Matrix access token from an existing boxel-cli profile (with MATRIX_TOKEN as a fallback), while keeping the existing local aibot login flow intact.
Changes:
- Document staging/production usage (via
--profile) and add an “error-heavy session” triage procedure to the skill docs. - Add
--profilesupport toinspect-room.mjsand prefer profile/env token auth before falling back to localaibotlogin.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .claude/skills/inspect-ai-room/SKILL.md | Updates skill documentation for staging/production authentication and adds a debugging/triage workflow. |
| .claude/skills/inspect-ai-room/scripts/inspect-room.mjs | Adds --profile flag support and token-based auth selection for non-local Matrix environments. |
Suppressed comments (1)
.claude/skills/inspect-ai-room/scripts/inspect-room.mjs:39
loadProfile()usesfind()for matrixUrl substring matching, so if multiple profiles share the same Matrix URL (common when you have multiple accounts on staging/prod), the chosen profile is non-deterministic. Also, if a profile record is missingmatrixUrl, the script can silently fall back toMATRIX_URL/localhost and send the token to the wrong server.
function loadProfile(idOrHint) {
let file = path.join(os.homedir(), '.boxel-cli', 'profiles.json');
let profiles = JSON.parse(fs.readFileSync(file, 'utf8')).profiles ?? {};
let p =
profiles[idOrHint] ??
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add ability to inspect AI assistant rooms on staging and production with the inspect-ai-room skill. Until now the skill could only reach the local synapse, because it logs in as aibot with the dev password. Against deployed environments the aibot password is not available to the read-only AWS role, so the script now accepts
--profile <id|matrixUrl-substring>and reuses the Matrix access token that boxel-cli already stores in~/.boxel-cli/profiles.json. A rawMATRIX_TOKENenv var works as a fallback. The aibot login path is unchanged for local use.The profile's user must be a member of the room, which is the normal case when the person who ran the session is also the boxel-cli user. All subcommands (rooms, timeline, usage, state, raw) work this way; verified against a staging room.
SKILL.md documents the staging path and adds a short procedure for triaging a session that produced many errors: state, usage, timeline, then the raw payload of each failed tool result or code patch, classified as model, skill-text, or platform error, with realm-server logs for the platform ones.
🤖 Generated with Claude Code