Skip to content

Commit 87b451a

Browse files
committed
Merge remote-tracking branch 'origin/main'
# Conflicts: # src/commands/README.md # tests/tuistory/goals-summary.tuistory.test.ts
2 parents 5cd92ed + bb409c9 commit 87b451a

15 files changed

Lines changed: 96 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
@@ -1218,6 +1218,11 @@ Set `idleTimeoutMs` to a positive duration in milliseconds to change the idle pe
12181218

12191219
### Goals and auto mode
12201220

1221+
From 0.9.9, persistent goals are enabled by default. A stored
1222+
`features.slashGoal: false` keeps them disabled. Use
1223+
`/experiments disable slash_goal` to opt out, or
1224+
`/experiments enable slash_goal` to enable them again.
1225+
12211226
A goal is a standing instruction to keep working, so starting one switches the
12221227
session into auto mode: the agent drives its own turns and stops asking for tool
12231228
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
@@ -120,7 +120,9 @@ Persistent goal files survive between conversations, while execution and usage a
120120

121121
## Viewing and managing goals
122122

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

‎src/commands/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ Each command is a separate TypeScript file that exports:
3838
| `/tester` | `tester.ts` | Verify acceptance criteria, run declared project tests, and capture browser evidence |
3939
| `/tools` | `tools.ts` | Manage persisted meta-tools |
4040
| `/experiments` | `features.ts` | List and toggle experiments |
41-
| `/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`. |
42-
| `/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. |
41+
| `/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. |
42+
| `/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. |
4343
| `/squad` | `squad.ts`, `squadDesktop.ts` | Open the Autohand Squad app, installing the latest release when missing; subcommands manage the standalone runtime. |
4444
| `/squad view` | `squad.ts` | Inspect recorded independent Squad sessions for the current workspace |
4545
| `/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
@@ -170,10 +170,10 @@ export const FEATURE_REGISTRY: readonly FeatureDefinition[] = [
170170
{
171171
id: 'slash_goal',
172172
label: 'Slash goal',
173-
description: 'Enable experimental persistent goals across /goal, /goals, --goal, tools, RPC, and ACP.',
174-
stage: 'experimental',
173+
description: 'Manage persistent goals across /goal, /goals, --goal, tools, RPC, and ACP.',
174+
stage: 'stable',
175175
configPath: 'features.slashGoal',
176-
defaultEnabled: false,
176+
defaultEnabled: true,
177177
},
178178
{
179179
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
@@ -503,7 +503,7 @@ export interface FeatureFlagSettings {
503503
usageV2?: boolean;
504504
/** Enable AWS Bedrock provider support. */
505505
awsBedrockProvider?: boolean;
506-
/** Enable the experimental persistent /goal surface across CLI, tools, RPC, and ACP. */
506+
/** Enable persistent goals across CLI, tools, RPC, and ACP. Defaults to true. */
507507
slashGoal?: boolean;
508508
/** Expose `run_tool_script`: one sandboxed script that calls tools and returns only its result (default: false). */
509509
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
@@ -55,7 +55,7 @@ describe('feature registry', () => {
5555
expect(getFeatureState(config, 'mcp')?.enabled).toBe(true);
5656
expect(getFeatureState(config, 'chrome_integration')?.enabled).toBe(false);
5757
expect(getFeatureState(config, 'cli_usage_v2')?.enabled).toBe(true);
58-
expect(getFeatureState(config, 'slash_goal')?.enabled).toBe(false);
58+
expect(getFeatureState(config, 'slash_goal')?.enabled).toBe(true);
5959
expect(getFeatureState(config, 'automatic_specialists')?.enabled).toBe(true);
6060
expect(getFeatureState(config, 'experimental_fork')?.enabled).toBe(false);
6161
expect(getFeatureState(config, 'experimental_clone')?.enabled).toBe(false);
@@ -70,6 +70,20 @@ describe('feature registry', () => {
7070
expect(getFeatureState(config, 'automatic_specialists')?.enabled).toBe(false);
7171
});
7272

73+
it.each([true, false])('preserves an explicit slash_goal value of %s', (slashGoal) => {
74+
const config = makeConfig({ features: { slashGoal } });
75+
76+
expect(getFeatureState(config, 'slash_goal')?.enabled).toBe(slashGoal);
77+
expect(config.features?.slashGoal).toBe(slashGoal);
78+
});
79+
80+
it('presents persistent goals as a stable feature', () => {
81+
const feature = getFeatureState(makeConfig(), 'slash_goal');
82+
83+
expect(feature?.stage).toBe('stable');
84+
expect(feature?.description).not.toMatch(/experimental/i);
85+
});
86+
7387
it('keeps prompt caching experimental and disabled until explicitly enabled', () => {
7488
const config = makeConfig({ features: {} });
7589

@@ -291,8 +305,8 @@ describe('feature registry', () => {
291305
expect(getFeatureState(config, 'slash_goal')?.enabled).toBe(true);
292306
});
293307

294-
it('resolves slash_goals to the local goal experiment and omits the duplicate remote row', () => {
295-
const config = makeConfig();
308+
it('resolves slash_goals to the local goal feature and omits the duplicate remote row', () => {
309+
const config = makeConfig({ features: { slashGoal: false } });
296310
const remoteSnapshot = {
297311
success: true as const,
298312
environment: 'production',

0 commit comments

Comments
 (0)