Merge development_mik_6_1 into development #11

Merged
mik-tf merged 16 commits from development_mik_6_1 into development 2026-03-19 14:34:07 +00:00
Owner

Summary

  • Added hero services MCP integration (mcp_hero skill + config)
  • Added chat input to admin dashboard for agent interaction
  • Added model selector dropdown to admin chat UI
  • Fixed expandable message rows with proper JSON encoding
  • Set gpt-4o-mini as default LLM model
  • Session 9 fixes: 5 TODOs + AI assistant enhancements

Test plan

  • Verify Shrimp admin UI loads and chat works
  • Verify model selector dropdown
## Summary - Added hero services MCP integration (mcp_hero skill + config) - Added chat input to admin dashboard for agent interaction - Added model selector dropdown to admin chat UI - Fixed expandable message rows with proper JSON encoding - Set gpt-4o-mini as default LLM model - Session 9 fixes: 5 TODOs + AI assistant enhancements ## Test plan - [x] Verify Shrimp admin UI loads and chat works - [x] Verify model selector dropdown
- examples/skills/hero_services.skill.md: Shrimp skill with YAML
  frontmatter that guides the agent to use the hero MCP tools
  (list_services → register_service → get_interface → generate_code
  → execute_code) for Hero OS service orchestration
- examples/mcp.json.hero_example: workspace mcp.json template for
  spawning mcp_hero as a Shrimp MCP server
- .env.example: document setup steps for Hero OS services section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Match the model name to what AIBroker's modelsconfig.yml exposes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a chat box to the Messages tab so users can send messages to
the agent directly from the Hero OS browser UI. Messages are processed
through the same agent loop as CLI/Telegram channels, with access to
all 41 built-in tools + MCP tools via AIBroker.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Users can now pick which LLM model to use from a dropdown next to the
chat input. The selected model is passed through the agent loop to
AIBroker, overriding the default. All models in the dropdown are
sourced from the Shrimp config (which matches AIBroker's model list).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Content with newlines/quotes broke the data-full HTML attribute,
preventing click-to-expand on message rows. Fixed by using
JSON.stringify for safe encoding in messages, audit, and memories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Chat responses now stream via Server-Sent Events instead of waiting
for the full response. Frontend uses ReadableStream reader for
real-time display of partial responses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Songs: 3 per context (acid_trumpet, gymnopedie_no1, there_it_is), orphan TOMLs removed
- Embedder: ensure_models_downloaded() in lib, called from hero_osis_server init
- AI Assistant: SSE parser for Shrimp responses, message field fix
- Auth/Redis SSO: postMessage token from island components + sso-login endpoint
- AI stop button with AbortController
- Multi-conversation support (Shrimp backend + UI sidebar + localStorage persistence)

Issue: lhumina_code/home#23

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- hero_services: add socat bridge TCP:3377→hero_osis_ui.sock for hero_biz,
  delete hero_cloud.toml (replaced by hero_compute)
- hero_archipelagos: compute island → hero_compute_ui, sidebar rename
  fix (onkeydown+onblur), delete confirmation dialog, sidebar styling
- hero_auth: SSO in base.html (covers setup+login+all pages)
- hero_shrimp: wrap persistMessage in try-catch to prevent crash

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merge remote-tracking branch 'origin/development' into development_mik_6_1
Some checks failed
CI / verify (pull_request) Failing after 6s
7da2fb1db4
# Conflicts:
#	src/channels/admin.ts
#	src/core/db.ts
Author
Owner

@thabeta lmk what you think! It is live at hero.gent04.grid.tf (admin, admin, for credentials).
As I see it, we can merge this and then you make an issue/review if we need to change/update something, for example you had good deep design feedback lately.

Thanks!

@thabeta lmk what you think! It is live at hero.gent04.grid.tf (admin, admin, for credentials). As I see it, we can merge this and then you make an issue/review if we need to change/update something, for example you had good deep design feedback lately. Thanks!
Owner

I checked the AI assistant but for some reason it's not capable of doing the basic tasks like these ? image

I checked the AI assistant but for some reason it's not capable of doing the basic tasks like these ? ![image](/attachments/bd5b110c-b9a2-4a1c-8b6e-5063c42c0ef6)
160 KiB
thabeta left a comment
Owner

Requesting changes based on two functional regressions in the new admin conversation/chat flow.

Findings:

  1. GET /api/conversations/:id/messages returns raw message content and bypasses the existing secret-redaction path used by GET /api/messages.
  2. POST /api/chat accepts any conversation_id and persists messages even when that conversation does not exist, which creates orphaned history that the conversation endpoints cannot retrieve.

I also verified locally on the PR branch that bun run typecheck, bun test, bun run doctor, bun run doctor:maintenance, bun run doctor:snapshot:export, and bun run doctor:snapshot:import all pass when run sequentially.

Requesting changes based on two functional regressions in the new admin conversation/chat flow. Findings: 1. `GET /api/conversations/:id/messages` returns raw message content and bypasses the existing secret-redaction path used by `GET /api/messages`. 2. `POST /api/chat` accepts any `conversation_id` and persists messages even when that conversation does not exist, which creates orphaned history that the conversation endpoints cannot retrieve. I also verified locally on the PR branch that `bun run typecheck`, `bun test`, `bun run doctor`, `bun run doctor:maintenance`, `bun run doctor:snapshot:export`, and `bun run doctor:snapshot:import` all pass when run sequentially.
@ -219,0 +251,4 @@
if (!conv) {
return Response.json({ error: "Conversation not found" }, { status: 404 });
}
const msgs = getMessagesByConversation(convId, 100);
Owner

This new conversation-history endpoint returns getMessagesByConversation() directly, so it skips the redactSecretsInText() pass used by /api/messages. Conversation-scoped messages can therefore expose stored secrets back to the admin API/UI. Please redact content here before returning.

This new conversation-history endpoint returns `getMessagesByConversation()` directly, so it skips the `redactSecretsInText()` pass used by `/api/messages`. Conversation-scoped messages can therefore expose stored secrets back to the admin API/UI. Please redact `content` here before returning.
@ -219,0 +291,4 @@
if (!message) {
return Response.json({ error: "message is required" }, { status: 400 });
}
const conversationId = body?.conversation_id || undefined;
Owner

conversation_id is accepted blindly and forwarded into persistence. Because there is no FK on messages.conversation_id and saveMessageWithConversation() does not verify existence, a typo or stale ID creates orphaned messages that /api/conversations/:id/messages will later reject with 404. Please validate the conversation before processing the chat request.

`conversation_id` is accepted blindly and forwarded into persistence. Because there is no FK on `messages.conversation_id` and `saveMessageWithConversation()` does not verify existence, a typo or stale ID creates orphaned messages that `/api/conversations/:id/messages` will later reject with 404. Please validate the conversation before processing the chat request.
feat: plumb context_name through agent pipeline to MCP tools
Some checks failed
CI / verify (pull_request) Failing after 21s
cb9557f1f4
- Accept context_name in /api/chat request body
- Thread contextName through contract → agent → ToolContext
- Inject context hint into LLM system prompt so it passes context
  parameter to MCP tools that support workspace scoping

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: add 15s timeout to MCP server JSON-RPC requests
Some checks failed
CI / verify (pull_request) Failing after 18s
2caef49341
Without timeout, a hanging bridge script blocks shrimp startup
indefinitely — preventing the HTTP server from binding. Now failing
MCP servers time out and are skipped gracefully.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: add direct HTTP-over-Unix-socket MCP transport
Some checks failed
CI / verify (pull_request) Failing after 19s
2811a33173
Replace broken stdio bridge scripts with UnixSocketMcpServer that
talks HTTP directly to service Unix sockets. Uses Bun's native
fetch({unix:...}) with curl fallback. Stdio transport kept for
external MCP servers. All 54 MCP tools from 6 services now load
successfully. Closes lhumina_code/home#34.

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

@thabeta thanks checking all this. Yes it was not 100% done but latest changes made should really help. All MCP + services work, even with creation event now. Will review your feedback to ensure I cover it all.

@thabeta thanks checking all this. Yes it was not 100% done but latest changes made should really help. All MCP + services work, even with creation event now. Will review your feedback to ensure I cover it all.
fix: address PR #11 review — redact conversation messages, validate conversation_id
Some checks failed
CI / verify (pull_request) Failing after 19s
d912740772
1. GET /api/conversations/:id/messages now applies redactSecretsInText()
   to message content before returning, matching the existing behavior
   of GET /api/messages.

2. POST /api/chat validates conversation_id exists before processing,
   returning 404 if the conversation is not found instead of creating
   orphaned messages.

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

Addressed both review items

@thabeta Both issues from your review are fixed in commit d912740:

1. Secret redaction on conversation messages

GET /api/conversations/:id/messages now applies redactSecretsInText() to content before returning — matching the existing pattern in GET /api/messages.

2. Conversation ID validation on chat

POST /api/chat now validates conversation_id exists before processing. Returns 404 {"error": "Conversation not found"} for invalid/stale IDs instead of creating orphaned messages.

Verified on herodev

  • Chat with invalid conversation_id → 404
  • Chat with valid conversation_id → success, messages persisted correctly
  • GET /conversations/:id/messages → content redacted
  • GET /conversations/fake-id/messages → 404

Also in this push

  • 2811a33: Direct HTTP-over-Unix-socket MCP transport — fixes the AI assistant MCP integration (all 54 tools now load, end-to-end verified)
## Addressed both review items @thabeta Both issues from your review are fixed in commit `d912740`: ### 1. Secret redaction on conversation messages ✅ `GET /api/conversations/:id/messages` now applies `redactSecretsInText()` to `content` before returning — matching the existing pattern in `GET /api/messages`. ### 2. Conversation ID validation on chat ✅ `POST /api/chat` now validates `conversation_id` exists before processing. Returns `404 {"error": "Conversation not found"}` for invalid/stale IDs instead of creating orphaned messages. ### Verified on herodev - Chat with invalid `conversation_id` → 404 ✅ - Chat with valid `conversation_id` → success, messages persisted correctly ✅ - `GET /conversations/:id/messages` → content redacted ✅ - `GET /conversations/fake-id/messages` → 404 ✅ ### Also in this push - `2811a33`: Direct HTTP-over-Unix-socket MCP transport — fixes the AI assistant MCP integration (all 54 tools now load, end-to-end verified)
refactor: remove aibroker MCP REST client — shrimp uses direct bridges only
Some checks failed
CI / verify (pull_request) Failing after 2s
7196db1131
- Delete mcp.ts (aibroker REST /tools discovery + execution)
- Remove discoverMCPTools() from loader.ts Promise.all
- Keep mcp_manager.ts (direct bridge spawning via mcp.json)
- Shrimp now loads MCP tools only from local bridge processes

Part of #36
fix: migrate CI from GitHub Actions to Forgejo runner
Some checks failed
Test / verify (pull_request) Failing after 37s
5fa968d6d4
The old .github/workflows/ci.yml used actions/checkout@v4 which
requires node — not available on the Forgejo runner. Replaced with
.forgejo/workflows/test.yaml using oven/bun:1 container, manual
git clone checkout, and the same verify steps.
fix: reset data dir before doctor health check in CI
All checks were successful
Test / verify (pull_request) Successful in 25s
c22eed5c9f
Tests pollute the shared SQLite DB (dead letter from outbox test).
Config singleton caches dataDir at import time so test env var
changes don't take effect. Reset gives doctor a clean DB to validate.
Author
Owner

CI fixed, all green.

What was wrong:

  • The old .github/workflows/ci.yml used actions/checkout@v4 which needs node — doesn't exist on our Forgejo runner. Replaced with .forgejo/workflows/test.yaml using oven/bun:1 container and manual git clone.

  • Doctor health check failed because bun test leaves a dead letter in the SQLite DB (the outbox test creates one on purpose). Doctor sees dead=1 and fails. The test tries to isolate via a temp dir but config.ts caches dataDir at import time so the override doesn't stick. Fix: reset the data dir before doctor runs. Proper fix would be late-binding config, but that's a separate refactor.

Previous review feedback (secret redaction, conversation_id validation) already addressed.

CI fixed, all green. **What was wrong:** - The old `.github/workflows/ci.yml` used `actions/checkout@v4` which needs `node` — doesn't exist on our Forgejo runner. Replaced with `.forgejo/workflows/test.yaml` using `oven/bun:1` container and manual git clone. - Doctor health check failed because `bun test` leaves a dead letter in the SQLite DB (the outbox test creates one on purpose). Doctor sees `dead=1` and fails. The test tries to isolate via a temp dir but `config.ts` caches `dataDir` at import time so the override doesn't stick. Fix: reset the data dir before doctor runs. Proper fix would be late-binding config, but that's a separate refactor. Previous review feedback (secret redaction, conversation_id validation) already addressed.
mik-tf merged commit a805809917 into development 2026-03-19 14:34:07 +00:00
mik-tf deleted branch development_mik_6_1 2026-03-19 14:34:08 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_shrimp!11
No description provided.