Skip to content

Add read-only whid-member agent mode with intent classifier - #84

Open
benrucker wants to merge 1 commit into
developfrom
jermabot/expand-jermabot-s-agent-feature-to-allow-20260816-135254
Open

Add read-only whid-member agent mode with intent classifier#84
benrucker wants to merge 1 commit into
developfrom
jermabot/expand-jermabot-s-agent-feature-to-allow-20260816-135254

Conversation

@benrucker

Copy link
Copy Markdown
Owner

Add read-only whid-member agent mode with intent classifier

Extends the JermaBot coding agent so whid Discord server members can ping the bot for conversational/code-question responses, without any mutation side effects.

What changed

agent_config.py

  • Added WHID_GUILD_ID = 173840048343482368
  • Added get_readonly_conversations_root() (env JERMABOT_AGENT_READONLY_DIR, default ~/jermabot-agent/readonly-conversations)

agent_runner.py

  • _make_path_guard now accepts an allowed_tools parameter (default AGENT_TOOLS) so the readonly guard enforces READONLY_AGENT_TOOLS = ['Read', 'Glob', 'Grep'] at the hook layer as well as at the options layer
  • classify_intent(message_text) — single-turn, no-tool Claude session that returns True only if the message is a genuine conversational request (not a garbled command); silently returns False on any error
  • _build_readonly_instructions / _build_readonly_options / run_readonly_agent — readonly analogue of the owner pipeline: same streaming/timeout mechanics, no Edit/Write/NotebookEdit tools, no _split_reply, returns AgentRunResult with empty title/body

agent_service.py

  • ReadonlyConversation — lightweight in-memory dataclass (session ID + last-active + lock); no disk persistence since no git state accumulates
  • ReadonlyAgentTaskService — same start/close/has_conversation/run interface as AgentTaskService; shares the pristine clone workspace root as cwd (so relative paths resolve naturally), saves image attachments under workspace_root/_attachments/<key>/, never calls publish_turn

agent.py

  • Agent.__init__ / cog_load / cog_unload wire up readonly_service alongside service
  • on_message splits into two fully separate branches: owner path (unchanged) and whid-member path (new); both share the _strip_mention / _is_own_thread helpers
  • _is_whid_member — guild-ID check
  • _handle_readonly_prompt — same Discord mechanics as _handle_prompt (typing indicator, lazy thread creation, chunked sends), minus the PR-link reporting block

Behaviour

Trigger Who Intent check Edits/PRs
Ping anywhere Owner No Yes
Thread reply (bot-owned) Owner No Yes
Ping in whid Whid member Yes — silent if NO No
Thread reply (bot-owned, established) Whid member No (already in session) No
Ping outside whid Non-owner — (ignored)

Opened by the JermaBot coding agent at the owner's request via Discord.

Requested via Discord:

expand jermabot’s agent feature to allow usage by non-owner users. Usage should be limited to people in whid. This new entry point counts as a new “mode” in my opinion. This mode of operation follows a more untrusted model: it never results in a PR or any other mutation-type side effects.  This mode also has an additional layer in front of its usage: an intent classifier. The intent classifier answers “does the user want a natural-language response from JermaBot?” The agent capabilities are only activated if the answer to that question is “yes.” This avoids accidental invocations, e.g. upon a misspelled command.
@benrucker benrucker changed the title The path guard prevents memory writes from this session — that's fine. Add read-only whid-member agent mode with intent classifier Aug 16, 2026
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.

1 participant