feat(claw): provision the workspace git identity at boot
Every forge thread works in a per-thread workspace, and implementer turns end in commits. git commit refuses to run without user.name and user.email, and a fresh workspace carries no gitconfig: the first commit on a fresh image fails, or succeeds with whatever the agent improvised. The agent commits as itself — its own name and address, never the user's, never inferred from whatever accounts happen to exist. The identity store gains an email field beside the name, so what onboarding collects with identity_set and the Agent · General page edits is what commits carry. The config gains an optional git section, an operator's override. Each field resolves independently: config, then identity, then defaults (claw, claw@hostname). The resolved pair is written into the daemon user's global git config at boot, in both run shapes — a cron pass commits too. The write is guarded: the settings store remembers the last pair the daemon wrote, and boot rewrites a field only when the config still holds that pair or nothing. A value anyone else set wins outright; the daemon is a tenant of its user's machine, not the owner of its git config. Provisioning runs from the binary's boot, not daemon assembly, so the tests that build daemons never touch a real gitconfig. An ssh sandbox runs git on another host and stays unprovisioned — a later story. The web UI gains an Email row on Agent · General; the phone's wire model gains the optional field.
This commit is contained in:
1 parent
6a81dfa466
commit
1b85cd8937
17 files changed
+598
-13
No files matched your search
@@ -24,6 +24,7 @@ const emit = defineEmits<{
|
||||
// The draft: '' means "clear this field", matching the wire.
|
||||
const draft = ref<IdentityTexts>({
|
||||
name: '',
|
||||
email: '',
|
||||
mark: '',
|
||||
initials: '',
|
||||
tagline: '',
|
||||
@@ -35,6 +36,7 @@ const dirty = computed(() => {
|
||||
if (!identity) return false
|
||||
return (
|
||||
draft.value.name !== (identity.name ?? '') ||
|
||||
draft.value.email !== (identity.email ?? '') ||
|
||||
draft.value.mark !== (identity.mark ?? '') ||
|
||||
draft.value.initials !== (identity.initials ?? '') ||
|
||||
draft.value.tagline !== (identity.tagline ?? '') ||
|
||||
@@ -47,6 +49,7 @@ function discard(): void {
|
||||
if (!identity) return
|
||||
draft.value = {
|
||||
name: identity.name ?? '',
|
||||
email: identity.email ?? '',
|
||||
mark: identity.mark ?? '',
|
||||
initials: identity.initials ?? '',
|
||||
tagline: identity.tagline ?? '',
|
||||
@@ -66,6 +69,7 @@ watch(
|
||||
initialized.value = true
|
||||
draft.value = {
|
||||
name: identity.name ?? '',
|
||||
email: identity.email ?? '',
|
||||
mark: identity.mark ?? '',
|
||||
initials: identity.initials ?? '',
|
||||
tagline: identity.tagline ?? '',
|
||||
@@ -97,6 +101,7 @@ function onImageChosen(kind: AgentImageKind, event: Event): void {
|
||||
|
||||
const CAPS: Record<keyof IdentityTexts, number> = {
|
||||
name: 64,
|
||||
email: 120,
|
||||
mark: 8,
|
||||
initials: 4,
|
||||
tagline: 120,
|
||||
@@ -142,7 +147,7 @@ const CAPS: Record<keyof IdentityTexts, number> = {
|
||||
<SettingCard v-if="identity" title="Agent identity">
|
||||
<SettingRow
|
||||
title="Display name"
|
||||
description="Shown as the author of messages, in the window title, and in notifications."
|
||||
description="Shown as the author of messages, in the window title, in notifications, and as the author name on commits in workspaces."
|
||||
>
|
||||
<input
|
||||
v-model="draft.name"
|
||||
@@ -153,6 +158,19 @@ const CAPS: Record<keyof IdentityTexts, number> = {
|
||||
:disabled="saving"
|
||||
/>
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
title="Email"
|
||||
description="The author address on commits the agent makes in its workspaces."
|
||||
>
|
||||
<input
|
||||
v-model="draft.email"
|
||||
type="email"
|
||||
:maxlength="CAPS.email"
|
||||
placeholder="claw@example.net"
|
||||
autocomplete="off"
|
||||
:disabled="saving"
|
||||
/>
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
title="Mark"
|
||||
description="The glyph or emoji in the rail and the empty states. Defaults to ῥ."
|
||||
|
||||
@@ -192,6 +192,7 @@ export interface ProvidersState {
|
||||
* unset text fields read as null, the images report presence. */
|
||||
export interface AgentIdentity {
|
||||
name: string | null
|
||||
email: string | null
|
||||
mark: string | null
|
||||
initials: string | null
|
||||
tagline: string | null
|
||||
@@ -204,6 +205,7 @@ export interface AgentIdentity {
|
||||
* string clears the field. */
|
||||
export interface IdentityTexts {
|
||||
name: string
|
||||
email: string
|
||||
mark: string
|
||||
initials: string
|
||||
tagline: string
|
||||
|
||||
Reference in new issue
Block a user