跳转到内容

Camofox Browser Profile & Session

Browser tools talk to Camofox over HTTP. Profile holds login state; session is a work line under that profile.

Configure under Habitat settings → Advanced → browser / camofox (browser.camofox.* in habitat_runtime_config).

ConceptConfig / fieldWhat it owns
ProfileCamofox userId (user_id, or derived when managed_persistence)Cookies, login, local storage — “who is browsing”
SessionCamofox sessionKey (session_key, or derived per Habitat conversation)Tab / task line under that profile — create and adopt tabs

One profile can have many sessions. Same profile + different sessions share login state but keep separate tab lines.

Habitat conversationId is only the in-process map key for the cached Camofox session object; it is not Camofox’s sessionKey itself (often derived from it).

When a Habitat conversation first opens a Camofox session:

  1. user_id set → use that profile; session_key if set, else task_
    • conversation id prefix. Ignores managed_persistence.
  2. Else managed_persistence not false (default true) → stable userId from ~/.anima/browser_auth/camofox; sessionKey derived per conversation.
  3. Else (managed_persistence: false) → ephemeral random userId — no persistent profile.

session_key alone does nothing; it only applies when user_id is set.

FieldDefault (when unset)Meaning
base_url(required for tools)Camofox REST base URL
timeout_ms30000Per-request HTTP timeout
managed_persistencetrueReuse a stable local profile when user_id is unset
adopt_existing_tabtrueAfter restart, try to adopt an existing tab for the same profile/session
user_idunsetExplicit Camofox profile id (highest priority)
session_keyunsetExplicit session key under that profile (only with user_id)

Unset booleans are treated as on (!== false). Set explicitly to false to disable.

GoalConfig
Remember logins on this Habitat (default)Leave fields unset, or managed_persistence: true
Ephemeral browsing (no shared login)managed_persistence: false
Share / pin a Camofox profileSet user_id; add session_key only if you need a fixed session line

Implementation: src/host/capabilities/tools/browser-camofox.ts.