Made Jarvis more mobile friendly

This commit is contained in:
2026-04-21 11:00:39 +02:00
parent a72eef4b82
commit eaea8d94b1
14 changed files with 604 additions and 97 deletions
+4 -4
View File
@@ -28,13 +28,13 @@ async def list_accounts(user_id: str | None = None) -> list[dict]:
pool = await get_pool()
if user_id is None:
rows = await pool.fetch(
"SELECT ea.*, a.name AS agent_name, a.model AS agent_model, a.prompt AS agent_prompt FROM email_accounts ea"
"SELECT ea.*, a.name AS agent_name, a.model AS agent_model, a.prompt AS agent_prompt, a.max_tool_calls AS agent_max_tool_calls, a.prompt_mode AS agent_prompt_mode FROM email_accounts ea"
" LEFT JOIN agents a ON a.id = ea.agent_id"
" ORDER BY ea.created_at"
)
else:
rows = await pool.fetch(
"SELECT ea.*, a.name AS agent_name, a.model AS agent_model, a.prompt AS agent_prompt FROM email_accounts ea"
"SELECT ea.*, a.name AS agent_name, a.model AS agent_model, a.prompt AS agent_prompt, a.max_tool_calls AS agent_max_tool_calls, a.prompt_mode AS agent_prompt_mode FROM email_accounts ea"
" LEFT JOIN agents a ON a.id = ea.agent_id"
" WHERE ea.user_id = $1 ORDER BY ea.created_at",
user_id,
@@ -46,7 +46,7 @@ async def list_accounts_enabled() -> list[dict]:
"""Return all enabled accounts (used by listener on startup)."""
pool = await get_pool()
rows = await pool.fetch(
"SELECT ea.*, a.name AS agent_name, a.model AS agent_model, a.prompt AS agent_prompt FROM email_accounts ea"
"SELECT ea.*, a.name AS agent_name, a.model AS agent_model, a.prompt AS agent_prompt, a.max_tool_calls AS agent_max_tool_calls, a.prompt_mode AS agent_prompt_mode FROM email_accounts ea"
" LEFT JOIN agents a ON a.id = ea.agent_id"
" WHERE ea.enabled = TRUE ORDER BY ea.created_at"
)
@@ -56,7 +56,7 @@ async def list_accounts_enabled() -> list[dict]:
async def get_account(account_id: str) -> dict | None:
pool = await get_pool()
row = await pool.fetchrow(
"SELECT ea.*, a.name AS agent_name, a.model AS agent_model, a.prompt AS agent_prompt FROM email_accounts ea"
"SELECT ea.*, a.name AS agent_name, a.model AS agent_model, a.prompt AS agent_prompt, a.max_tool_calls AS agent_max_tool_calls, a.prompt_mode AS agent_prompt_mode FROM email_accounts ea"
" LEFT JOIN agents a ON a.id = ea.agent_id"
" WHERE ea.id = $1",
account_id,
+4 -2
View File
@@ -496,8 +496,10 @@ class EmailAccountListener:
f"- Memory file: {mem_path}\n"
f"- Reasoning log: {log_path}\n"
f"Read the memory file before acting. "
f"Append a reasoning entry to the reasoning log for each email you act on. "
f"If either file doesn't exist yet, create it with an appropriate template."
f"Append a brief reasoning entry to the reasoning log for each email you act on. "
f"If either file doesn't exist yet, create it with an appropriate template. "
f"If the memory file exceeds 120 lines, summarise it in-place (condense key facts, "
f"drop old entries) before appending — keep it concise to reduce token costs."
)
await agent_runner.run_agent_and_wait(