mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:11:36 +00:00
feat: append workspace critical rules to compaction summary
- Add readWorkspaceContextForSummary() to extract Session Startup + Red Lines from AGENTS.md - Inject workspace context into compaction summary (limited to 2000 chars) - Export extractSections() from post-compaction-context.ts for reuse - Ensures compaction summary includes core rules needed for recovery Part 1 of post-compaction context injection feature.
This commit is contained in:
@@ -49,7 +49,7 @@ export async function readPostCompactionContext(workspaceDir: string): Promise<s
|
||||
* Skips content inside fenced code blocks.
|
||||
* Captures until the next heading of same or higher level, or end of string.
|
||||
*/
|
||||
function extractSections(content: string, sectionNames: string[]): string[] {
|
||||
export function extractSections(content: string, sectionNames: string[]): string[] {
|
||||
const results: string[] = [];
|
||||
const lines = content.split("\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user