MCPcopy Index your code
hub / github.com/AI45Lab/Code / SessionOptions

Class SessionOptions

sdk/node/src/lib.rs:1779–1983  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1777#[napi(object)]
1778#[derive(Default)]
1779pub struct SessionOptions {
1780 /// Override the default model. Format: "provider/model" (e.g., "openai/gpt-4o").
1781 pub model: Option<String>,
1782 /// Enable built-in skills (4 skills: code-search, code-review, explain-code, find-bugs).
1783 pub builtin_skills: Option<bool>,
1784 /// Extra directories to scan for skill files (.md with YAML frontmatter).
1785 pub skill_dirs: Option<Vec<String>>,
1786 /// Whether active skill allowed-tools restrict ordinary session tool calls.
1787 ///
1788 /// Defaults to false. Set true to restore the legacy global active-skill
1789 /// restriction before permission policy, hooks, HITL, or AHP run.
1790 pub enforce_active_skill_tool_restrictions: Option<bool>,
1791 /// Extra directories to scan for agent files.
1792 pub agent_dirs: Option<Vec<String>>,
1793 /// Reproducible disposable workers to register for task delegation.
1794 pub worker_agents: Option<Vec<WorkerAgentSpec>>,
1795 /// Optional advanced queue configuration for explicit external/hybrid lane dispatch.
1796 ///
1797 /// Ordinary sessions are queue-free unless this is provided.
1798 pub queue_config: Option<SessionQueueConfig>,
1799 /// Explicit permission policy for tool execution.
1800 pub permission_policy: Option<PermissionPolicy>,
1801 /// Explicit planning mode: "auto", "enabled", or "disabled".
1802 ///
1803 /// Prefer this over `planning` when the caller needs an unambiguous SDK contract.
1804 /// If both are set, `planningMode` wins.
1805 pub planning_mode: Option<String>,
1806 /// Legacy planning shortcut. Omit for auto planning, true to force planning, false to disable.
1807 pub planning: Option<bool>,
1808 /// Enable goal tracking (default: false).
1809 pub goal_tracking: Option<bool>,
1810 /// Max consecutive parse errors before abort.
1811 pub max_parse_retries: Option<u32>,
1812 /// Per-tool execution timeout in milliseconds.
1813 pub tool_timeout_ms: Option<f64>,
1814 /// Max LLM API failures before abort.
1815 pub circuit_breaker_threshold: Option<u32>,
1816 /// Enable auto-compaction when context window fills up (default: false).
1817 pub auto_compact: Option<bool>,
1818 /// Context usage threshold (0.0–1.0) to trigger auto-compaction (default: 0.8).
1819 pub auto_compact_threshold: Option<f64>,
1820 /// Retention limits for large tool/program artifacts.
1821 pub artifact_store_limits: Option<ArtifactStoreLimits>,
1822 /// Long-term memory store backend.
1823 ///
1824 /// Pass `new FileMemoryStore("./memory")` for file-based persistence.
1825 /// ```js
1826 /// agent.session('.', { memoryStore: new FileMemoryStore('./memory') });
1827 /// ```
1828 pub memory_store: Option<JsMemoryStore>,
1829 /// Session persistence store backend.
1830 ///
1831 /// Pass `new FileSessionStore("./sessions")` to persist sessions to disk,
1832 /// or `new MemorySessionStore()` for an ephemeral in-process store.
1833 /// ```js
1834 /// agent.session('.', {
1835 /// sessionStore: new FileSessionStore('./sessions'),
1836 /// sessionId: 'my-session',

Callers 11

mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
_make_sessionFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
make_monitored_sessionFunction · 0.50
_ensure_sessionMethod · 0.50

Calls

no outgoing calls

Tested by 6

mainFunction · 0.40
mainFunction · 0.40
mainFunction · 0.40
_make_sessionFunction · 0.40
mainFunction · 0.40
make_monitored_sessionFunction · 0.40