Feat/aiclaw prompt mode#1252
Open
ThanhDang-Vn wants to merge 14 commits into
Open
Conversation
feat: add header
Cut AGENTS.md, AGENTS_TASK.md, SOUL.md and TOOLS.md down to their essentials and lower mcpToolInlineMaxCount from 40 to 20 so excess MCP tool schemas defer to mcp_tool_search instead of being inlined on every request. Both reduce the per-request system-prompt token cost.
Introduce a fifth prompt mode "aiclaw" for ai-claw company assistants: task-tier system-prompt sections plus an MCP-first focused tool surface. - systemprompt: add PromptAiClaw mode (task-tier rank, shared section gating) and skip the persona recency reminder for Anthropic open agents. - tools: modeAiClawToolAllowlist for built-in tools; the PromptAiClaw filter also keeps any tool in the "mcp" group so MCP tools activated via mcp_tool_search are not stripped after discovery. - bootstrap: AGENTS_AICLAW.md doctrine template wired into ModeAllowlist and seed lists; mark it as a stable context file for prompt caching. - store/http: accept and preview the aiclaw mode. - web + desktop UI: surface the aiclaw mode (card, badge, schema, i18n).
cd686fe to
1274314
Compare
mrgoonie
requested changes
Jun 21, 2026
mrgoonie
left a comment
Contributor
There was a problem hiding this comment.
Summary: This PR is not mergeable upstream as-is. It mixes an ai-claw prompt-mode feature with fork-specific README/Docker changes and a security-sensitive outbound MCP auth change, but does not include the product/security contract or tests needed for those surfaces.
Risk level: High
Mandatory gates:
- Duplicate/prior implementation: no exact duplicate found for
aiclawprompt mode. - Project standards: issue found — upstream docs and default Docker Compose are changed to fork-specific ai-claw/trwng-thdat values, and the MCP auth behavior is untested.
- Strategic necessity: questionable as packaged. A dedicated ai-claw prompt mode may be useful, but this PR currently bundles unrelated fork branding/deployment edits and a bearer-token injection path.
- CI/checks: missing/no checks reported; mergeState is
UNSTABLE.
Findings:
- Critical:
README.mdrewrites upstream installation guidance to clonegithub.qkg1.top/trwng-thdat/goclaw, labels this repo as a customized fork, and includes a localfile:///C:/HCMUS/Jarvis/ai-clawlink. That cannot ship innextlevelbuilder/goclaw; remove fork/product branding from upstream docs or move it to fork-only docs outside this PR. - Important:
docker-compose.ymladds a plaintext Postgres DSN and a defaultpostgresservice/host port mapping (5434:5432). This changes upstream runtime topology and secret handling for every Docker user without a migration/design note. Keep deployment-specific compose overrides out of the default compose file. - Important:
internal/mcp/auth.gointroducesMCP_RUNTIME_ACCESS_TOKENand injects it into outbound MCP requests. That is a security-sensitive trust-boundary change and needs explicit scoping docs plus tests proving the token is only sent to intended MCP endpoints, does not override per-server configured headers unexpectedly, and behaves safely when empty. - Important: The prompt-mode/tool-filter change is under-tested for the core behavior it claims to provide. Add tests covering
PromptAiClawmode selection, context-file allowlist, built-in tool allowlist, and preservation of MCP group tools aftermcp_tool_searchactivation. - Important: This PR edits the default bootstrap templates (
AGENTS.md,AGENTS_TASK.md,SOUL.md,TOOLS.md) substantially while the title/body describe only ai-claw prompt mode. Please split generic template compression/refactor from the ai-claw feature so reviewers can reason about behavior changes separately.
Verdict: REQUEST_CHANGES
Next step: split this into (1) a clean upstream ai-claw prompt-mode PR with focused tests, and (2) a separate design/security PR for MCP runtime auth if still needed. Remove fork README/Docker edits from upstream before re-review.
Posted by /github-maintain at 2026-06-21T17:21:30Z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type
main)Target Branch
Checklist
go build ./...passesgo build -tags sqliteonly ./...passes (if Go changes)go vet ./...passesgo test -race ./...cd ui/web && pnpm build(if UI changes)$1, $2(no string concat)internal/upgrade/version.go(if new migration)Test Plan