feat: audit log, usage tracking UI, OpenAI orchestrator compaction, onboarding + docs
Tool audit log:
- Every orchestrator tool call logged to home/{user}/tool_audit/YYYY-MM-DD.jsonl
- Files panel sidebar: audit log group (collapsed), date-linked read-only table
- Admin endpoints: /api/audit/files, /api/audit/day, /api/audit/recent, /api/audit/stats
- Engine and model name recorded per entry
OpenAI orchestrator improvements:
- Context budget enforcement: 75% of model context_k (min 16k)
- Message compaction: truncates old tool results when approaching budget
- max_rounds respected per model config (intersected with server cap)
OpenRouter onboarding (setup.html, onboarding.py, app.js, settings.html):
- Step 3 of 3: /setup/model with curated model picker
- Chat banner for users on server-default model (informational, not alarmist)
- Settings quick-link card; /setup/model works standalone for existing users
Model registry + session store:
- set_role_config / get_role_config for per-role tool lists and system_append
- session_store: session rename, session name backfill endpoint
UI updates (app.js, index.html, style.css, local_llm.html):
- Role toggle in context panel
- Off-the-record mode
- Agent notes read-only viewer
- OPERATIONS.md loaded at T2+ in context
Documentation:
- HELP.md: full tool table, per-role tool sets, Agent Notes, usage tracking
- TOOLS.md: Agent Notes section, count corrected to 44
- ARCH__SYSTEM.md, ARCH__BACKENDS.md, MASTER.md updated to match reality
- CLAUDE.md: onboarding flow, documentation philosophy sections
- README.md: stack in practice, DeepSeek TUI mention, architecture diagram updated
- TODO__Agents.md: onboarding task completed with deviation notes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,10 +27,21 @@ ALLOWED = {
|
||||
"MEMORY_SHORT.bak1.md",
|
||||
"MEMORY_SHORT.bak2.md",
|
||||
"HELP.md",
|
||||
# Agent private notes — backups only; AGENT_NOTES.md itself is agent-only
|
||||
"AGENT_NOTES.bak1.md",
|
||||
"AGENT_NOTES.bak2.md",
|
||||
"AGENT_NOTES.bak3.md",
|
||||
}
|
||||
|
||||
# Files that can be read via the panel but not written by users
|
||||
READ_ONLY = {
|
||||
"AGENT_NOTES.bak1.md",
|
||||
"AGENT_NOTES.bak2.md",
|
||||
"AGENT_NOTES.bak3.md",
|
||||
}
|
||||
|
||||
# Files served from home/{user}/ instead of persona path
|
||||
USER_FILES = {"email_allowlist.json"}
|
||||
USER_FILES = {"email_allowlist.json", "usage.json"}
|
||||
|
||||
|
||||
def _resolve(user: str, persona: str) -> None:
|
||||
@@ -92,7 +103,11 @@ async def get_file(
|
||||
p = _path(filename, user=user)
|
||||
if not p.exists():
|
||||
raise HTTPException(status_code=404, detail=f"{filename} does not exist")
|
||||
return {"name": filename, "content": p.read_text()}
|
||||
return {
|
||||
"name": filename,
|
||||
"content": p.read_text(),
|
||||
"readonly": filename in READ_ONLY,
|
||||
}
|
||||
|
||||
|
||||
class FileWrite(BaseModel):
|
||||
@@ -106,6 +121,8 @@ async def save_file(
|
||||
user: str = Query("scott"),
|
||||
persona: str = Query("inara"),
|
||||
) -> dict:
|
||||
if filename in READ_ONLY:
|
||||
raise HTTPException(status_code=403, detail=f"{filename} is read-only.")
|
||||
_resolve(user, persona)
|
||||
p = _path(filename, user=user)
|
||||
p.write_text(req.content)
|
||||
|
||||
Reference in New Issue
Block a user