Skip to content

Commit bb409c9

Browse files
authored
Enable persistent goals by default in 0.9.9
Enable persistent goals on fresh configurations, preserve explicit feature settings, and document the 0.9.9 default. Validated by all required CI unit, terminal and platform-build checks. No CLI release.
1 parent fcd92ec commit bb409c9

15 files changed

Lines changed: 95 additions & 18 deletions

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Changed
6+
7+
- Persistent goals (`/goal`, `/goals` and `--goal`) are enabled by default for 0.9.9. Existing explicit settings are preserved; `/experiments disable slash_goal` turns them off.
8+
59
### Breaking
610

711
`-c` now means `--continue` (as in Claude Code). Use `--auto-commit` for auto-commit.

‎docs/config-reference.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,11 @@ Set `idleTimeoutMs` to a positive duration in milliseconds to change the idle pe
11841184

11851185
### Goals and auto mode
11861186

1187+
From 0.9.9, persistent goals are enabled by default. A stored
1188+
`features.slashGoal: false` keeps them disabled. Use
1189+
`/experiments disable slash_goal` to opt out, or
1190+
`/experiments enable slash_goal` to enable them again.
1191+
11871192
A goal is a standing instruction to keep working, so starting one switches the
11881193
session into auto mode: the agent drives its own turns and stops asking for tool
11891194
approval until the goal is complete. Setting a new goal while one is active

‎docs/features.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ Persistent goal files survive between conversations, while execution and usage a
119119

120120
## Viewing and managing goals
121121

122-
If goals are disabled, run `/experiments enable slash_goal`. Open the panel with
122+
Goals are enabled by default from 0.9.9. Existing explicit settings are preserved.
123+
Turn goals off with `/experiments disable slash_goal`; turn them back on with
124+
`/experiments enable slash_goal`. Open the panel with
123125
`/goals`, `/goals view`, or `/goal view`. Opening the view does not start queued work.
124126
Without an interactive panel, the view command returns a read-only text snapshot.
125127

‎src/commands/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ Each command is a separate TypeScript file that exports:
3737
| `/tester` | `tester.ts` | Verify acceptance criteria, run declared project tests, and capture browser evidence |
3838
| `/tools` | `tools.ts` | Manage persisted meta-tools |
3939
| `/experiments` | `features.ts` | List and toggle experiments |
40-
| `/goal` | `goal.ts` | Manage session-attached persistent goals, budgets, templates, and queued work; bare `/goal` recovers a stranded queue only when no live peer owns it. Requires `slash_goal`. |
41-
| `/goals` | `goal.ts` | Open the live goal queue with keyboard and mouse editing. Accepts `/goal` subcommands and returns the queue as text without an interactive panel. Shares `slash_goal`; `/experiments enable slash_goals` enables the same local experiment. |
40+
| `/goal` | `goal.ts` | Manage session-attached persistent goals, budgets, templates, and queued work; bare `/goal` recovers a stranded queue only when no live peer owns it. Enabled by default from 0.9.9; explicit `slash_goal` settings are preserved. |
41+
| `/goals` | `goal.ts` | Open the live goal queue with keyboard and mouse editing. Accepts `/goal` subcommands and returns the queue as text without an interactive panel. Shares `slash_goal`; `/experiments enable slash_goals` enables the same local feature. |
4242
| `/squad` | `squad.ts` | Open/manage the standalone Autohand Squad runtime. |
4343
| `/squad view` | `squad.ts` | Inspect recorded independent Squad sessions for the current workspace |
4444
| `/usage` | `usage.ts` | Show Autohand plan limits and project token activity |

‎src/features/featureRegistry.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ export const FEATURE_REGISTRY: readonly FeatureDefinition[] = [
161161
{
162162
id: 'slash_goal',
163163
label: 'Slash goal',
164-
description: 'Enable experimental persistent goals across /goal, /goals, --goal, tools, RPC, and ACP.',
165-
stage: 'experimental',
164+
description: 'Manage persistent goals across /goal, /goals, --goal, tools, RPC, and ACP.',
165+
stage: 'stable',
166166
configPath: 'features.slashGoal',
167-
defaultEnabled: false,
167+
defaultEnabled: true,
168168
},
169169
{
170170
id: 'code_mode',

‎src/goals/feature.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { LoadedConfig } from '../types.js';
99
export const GOAL_FEATURE_ID = 'slash_goal';
1010

1111
export const GOAL_FEATURE_DISABLED_MESSAGE =
12-
'The /goal feature is behind slash_goal. Run /experiments enable slash_goal, then try again.';
12+
'The /goal feature is disabled in your settings. Run /experiments enable slash_goal, then try again.';
1313

1414
export function isGoalFeatureEnabled(config?: LoadedConfig | null): boolean {
1515
if (!config) return false;

‎src/types.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ export interface FeatureFlagSettings {
499499
usageV2?: boolean;
500500
/** Enable AWS Bedrock provider support. */
501501
awsBedrockProvider?: boolean;
502-
/** Enable the experimental persistent /goal surface across CLI, tools, RPC, and ACP. */
502+
/** Enable persistent goals across CLI, tools, RPC, and ACP. Defaults to true. */
503503
slashGoal?: boolean;
504504
/** Expose `run_tool_script`: one sandboxed script that calls tools and returns only its result (default: false). */
505505
codeMode?: boolean;

‎tests/commands/goal.test.ts‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,39 @@ describe('/goal command', () => {
5656
.toBe('create a reliable CLI goal');
5757
});
5858

59+
it('creates an interactive goal without an opt-in flag', async () => {
60+
const config = { configPath: path.join(workspaceRoot, 'config.json') };
61+
62+
const result = await goal({ ...ctx, config }, ['default interactive objective']);
63+
64+
expect(result).toContain('Goal created.');
65+
expect((await new GoalManager(workspaceRoot, { sessionId: 'session-current' }).getSessionSnapshot()).goal?.objective)
66+
.toBe('default interactive objective');
67+
});
68+
69+
it('creates a CLI goal without an opt-in flag', async () => {
70+
const config = { configPath: path.join(workspaceRoot, 'config.json') };
71+
72+
expect(await runGoalCli(workspaceRoot, 'default CLI objective', config)).toContain('Goal created.');
73+
expect((await new GoalManager(workspaceRoot).getSessionSnapshot()).goal?.objective)
74+
.toBe('default CLI objective');
75+
});
76+
77+
it('keeps explicitly disabled goals off across slash and CLI commands', async () => {
78+
const config = { ...ctx.config, features: { slashGoal: false } };
79+
80+
for (const result of [
81+
await goal({ ...ctx, config }, ['must remain disabled']),
82+
await runGoalCli(workspaceRoot, 'must remain disabled', config),
83+
]) {
84+
expect(result).toContain('/experiments enable slash_goal');
85+
expect(result).not.toMatch(/experimental|behind/i);
86+
}
87+
expect(config.features.slashGoal).toBe(false);
88+
expect(await fs.pathExists(path.join(workspaceRoot, '.autohand', 'goals.local.json'))).toBe(false);
89+
expect(queued).toEqual([]);
90+
});
91+
5992
it('preserves JSON completion evidence through the non-interactive command parser', async () => {
6093
const manager = new GoalManager(workspaceRoot);
6194
await manager.createGoal({ objective: 'CLI evidence', acceptanceCriteria: ['Tests pass'] });

‎tests/core/agent/SystemPromptBuilder.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ describe('SystemPromptBuilder', () => {
115115
});
116116

117117
it('only includes persistent goal guidance when slash_goal is enabled', async () => {
118-
const disabledPrompt = await createBuilder().build();
118+
const disabledPrompt = await createBuilder({ runtime: { options: {}, workspaceRoot: process.cwd(), config: { features: { slashGoal: false } } } }).build();
119119
const enabledPrompt = await createBuilder({
120120
runtime: {
121121
options: {},
@@ -128,6 +128,7 @@ describe('SystemPromptBuilder', () => {
128128
}).build();
129129

130130
expect(disabledPrompt).not.toContain('### Persistent Goals');
131+
expect(await createBuilder().build()).toContain('### Persistent Goals');
131132
expect(enabledPrompt).toContain('### Persistent Goals');
132133
expect(enabledPrompt).toContain('create_goal');
133134
expect(enabledPrompt).toContain('Persistent goal execution is session-scoped');

‎tests/features/featureRegistry.test.ts‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('feature registry', () => {
4848
expect(getFeatureState(config, 'mcp')?.enabled).toBe(true);
4949
expect(getFeatureState(config, 'chrome_integration')?.enabled).toBe(false);
5050
expect(getFeatureState(config, 'cli_usage_v2')?.enabled).toBe(true);
51-
expect(getFeatureState(config, 'slash_goal')?.enabled).toBe(false);
51+
expect(getFeatureState(config, 'slash_goal')?.enabled).toBe(true);
5252
expect(getFeatureState(config, 'automatic_specialists')?.enabled).toBe(true);
5353
expect(getFeatureState(config, 'experimental_fork')?.enabled).toBe(false);
5454
expect(getFeatureState(config, 'experimental_clone')?.enabled).toBe(false);
@@ -63,6 +63,20 @@ describe('feature registry', () => {
6363
expect(getFeatureState(config, 'automatic_specialists')?.enabled).toBe(false);
6464
});
6565

66+
it.each([true, false])('preserves an explicit slash_goal value of %s', (slashGoal) => {
67+
const config = makeConfig({ features: { slashGoal } });
68+
69+
expect(getFeatureState(config, 'slash_goal')?.enabled).toBe(slashGoal);
70+
expect(config.features?.slashGoal).toBe(slashGoal);
71+
});
72+
73+
it('presents persistent goals as a stable feature', () => {
74+
const feature = getFeatureState(makeConfig(), 'slash_goal');
75+
76+
expect(feature?.stage).toBe('stable');
77+
expect(feature?.description).not.toMatch(/experimental/i);
78+
});
79+
6680
it('keeps prompt caching experimental and disabled until explicitly enabled', () => {
6781
const config = makeConfig({ features: {} });
6882

@@ -284,8 +298,8 @@ describe('feature registry', () => {
284298
expect(getFeatureState(config, 'slash_goal')?.enabled).toBe(true);
285299
});
286300

287-
it('resolves slash_goals to the local goal experiment and omits the duplicate remote row', () => {
288-
const config = makeConfig();
301+
it('resolves slash_goals to the local goal feature and omits the duplicate remote row', () => {
302+
const config = makeConfig({ features: { slashGoal: false } });
289303
const remoteSnapshot = {
290304
success: true as const,
291305
environment: 'production',

0 commit comments

Comments
 (0)