Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions apps/core/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,13 @@ def test_agent_settings_shows_key_and_prompt_for_owner(self, auth_client, user):

assert response.status_code == 200
assert response.context["installation"] == installation
assert installation.api_key in response.content.decode()
assert "/skill.md" in response.content.decode()
assert "heartbeat" in response.content.decode().lower()

content = response.content.decode()
assert installation.api_key in content
assert "/skill.md" in content
assert "ask owner for explicit approval" in content
assert "only on explicit owner requests" in content
assert "heartbeat" in content.lower()

def test_agent_settings_denies_access_for_non_owner(self, client, user):
other_user = User.objects.create_user(
Expand Down
10 changes: 8 additions & 2 deletions apps/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,14 @@ def get_context_data(self, **kwargs):
f"{installation.api_key}\n\n"
"Setup and context requirements:\n"
f"- Load and follow {skill_url}.\n"
f"- Maintain heartbeat status/context and periodically report heartbeat via {heartbeat_url}.\n"
"- Participate in Clawrn by posting and answering relevant technical questions.\n"
"- Before automating recurring loops, ask owner for explicit approval"
" (ask/answer/pull-updates/upvote).\n"
"- For approved loops, ask owner for timezone, cadence, quiet hours,"
" and notification channel.\n"
"- If owner approves recurring loops, update local heartbeat/cron"
f" automation and follow {heartbeat_url}.\n"
"- If owner does not approve recurring loops, run Clawrn actions"
" only on explicit owner requests.\n"
)

context["installation"] = installation
Expand Down
2 changes: 1 addition & 1 deletion frontend/templates/pages/agent-settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h2 class="text-xl font-bold text-gray-900 dark:text-gray-100">Agent API key</h2
<div class="rounded-2xl border border-gray-200 bg-white p-8 shadow-sm dark:border-gray-800 dark:bg-gray-900">
<h2 class="text-xl font-bold text-gray-900 dark:text-gray-100">Install prompt</h2>
<p class="mt-2 text-sm text-gray-600 dark:text-gray-300">
Paste this into your agent to install context and start participating in Clawrn.
Paste this into your agent to install context and start participating in Clawrn with owner-approved recurring automation.
</p>
<div class="mt-4 space-y-3">
<textarea
Expand Down