Skip to content

Commit 73a90f3

Browse files
committed
fix(agent-core-v2): re-remind AGENTS.md after compaction and report enabled flags
Sessions no longer fail to start when the subagent model pool is misconfigured. The fork context notice is delivered as a reminder instead of being prepended to the prompt. Git status is parsed with -z so non-ASCII paths survive. Subdirectory AGENTS.md discoveries are re-injected after context compaction, and session_started telemetry carries the enabled experimental flag ids.
1 parent ff2b179 commit 73a90f3

29 files changed

Lines changed: 605 additions & 372 deletions

File tree

GOAL.md

Lines changed: 0 additions & 236 deletions
This file was deleted.

apps/pythinker-code/src/tui/commands/config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,14 @@ export async function applyExperimentalFeatureChanges(
810810
if (changes.some((change) => change.id === 'tower')) {
811811
host.showNotice('Tower mode takes effect after restarting Pythinker Code.');
812812
}
813-
host.track('experimental_features_apply', { changed: changes.length });
813+
host.track('experimental_features_apply', {
814+
changed: changes.length,
815+
flags: features
816+
.filter((feature) => feature.enabled)
817+
.map((feature) => feature.id)
818+
.toSorted()
819+
.join(','),
820+
});
814821
} catch (error) {
815822
host.showError(`Failed to update experimental features: ${formatErrorMessage(error)}`);
816823
}

apps/pythinker-code/test/tui/commands/experiments.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,30 @@ describe('experimental feature command handlers', () => {
9898
expect(host.mountEditorReplacement).not.toHaveBeenCalled();
9999
expect(host.track).toHaveBeenCalledWith('experimental_features_apply', {
100100
changed: 1,
101+
flags: '',
101102
});
102103
expect(host.showStatus).not.toHaveBeenCalledWith(
103104
'Experimental features updated.',
104105
darkColors.success,
105106
);
106107
});
107108

109+
it('reports the post-apply enabled flag set in telemetry', async () => {
110+
const host = makeHost();
111+
host.harness.getExperimentalFeatures.mockResolvedValue([
112+
feature({ id: 'wait_for', enabled: true }),
113+
feature({ id: 'subagent_fork', enabled: true }),
114+
feature({ id: 'tower', enabled: false }),
115+
]);
116+
117+
await applyExperimentalFeatureChanges(host, [{ id: 'subagent_fork', enabled: true }]);
118+
119+
expect(host.track).toHaveBeenCalledWith('experimental_features_apply', {
120+
changed: 1,
121+
flags: 'subagent_fork,wait_for',
122+
});
123+
});
124+
108125
it('does not write config when there are no drafted changes', async () => {
109126
const host = makeHost();
110127

packages/agent-core-v2/docs/state-manifest.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
// references become '(circular)', and class instances collapse to a '(ClassName)'
2828
// marker — the wire shape of an entry is the JSON projection of the type here.
2929
//
30-
// Index (App: 0 keys · Workspace: 6 keys · Session: 10 keys · Agent: 86 keys)
30+
// Index (App: 0 keys · Workspace: 6 keys · Session: 10 keys · Agent: 87 keys)
3131
// App
3232
// Workspace
3333
// workspaceDirs.ephemeralDirs src/workspace/workspaceDirs/workspaceDirsService.ts
@@ -56,6 +56,7 @@
5656
// agentPlugin.sessionStartRefreshPending src/agent/plugin/agentPluginService.ts
5757
// agentsMdReminder.cwd src/agent/agentsMdReminder/agentsMdReminderService.ts
5858
// agentsMdReminder.known src/agent/agentsMdReminder/agentsMdReminderService.ts
59+
// agentsMdReminder.pending src/agent/agentsMdReminder/agentsMdReminderService.ts
5960
// agentsMdReminder.seeded src/agent/agentsMdReminder/agentsMdReminderService.ts
6061
// contextMemory src/agent/contextMemory/contextOps.ts
6162
// contextProjector.lastRepairSignature src/agent/contextProjector/contextProjectorService.ts
@@ -1300,6 +1301,7 @@ export interface AgentStateSnapshot {
13001301
// src/agent/agentsMdReminder/agentsMdReminderService.ts
13011302
'agentsMdReminder.cwd': string | undefined;
13021303
'agentsMdReminder.known': Set<string>;
1304+
'agentsMdReminder.pending': Set<string>;
13031305
'agentsMdReminder.seeded': boolean;
13041306
// src/agent/contextMemory/contextOps.ts
13051307
// replayable · durable · undoable — folds: ContextAppendMessage, ContextAppendLoopEvent, ContextClear, ContextApplyCompaction

0 commit comments

Comments
 (0)