mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 08:32:43 +00:00
Merged via squash.
Prepared head SHA: 8cd6cc8049
Co-authored-by: echoVic <16428813+echoVic@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
This commit is contained in:
@@ -522,6 +522,7 @@ function appendSummarySection(summary: string, section: string): string {
|
||||
/**
|
||||
* Read and format critical workspace context for compaction summary.
|
||||
* Extracts "Session Startup" and "Red Lines" from AGENTS.md.
|
||||
* Falls back to legacy names "Every Session" and "Safety".
|
||||
* Limited to 2000 chars to avoid bloating the summary.
|
||||
*/
|
||||
async function readWorkspaceContextForSummary(): Promise<string> {
|
||||
@@ -546,7 +547,12 @@ async function readWorkspaceContextForSummary(): Promise<string> {
|
||||
fs.closeSync(opened.fd);
|
||||
}
|
||||
})();
|
||||
const sections = extractSections(content, ["Session Startup", "Red Lines"]);
|
||||
// Accept legacy section names ("Every Session", "Safety") as fallback
|
||||
// for backward compatibility with older AGENTS.md templates.
|
||||
let sections = extractSections(content, ["Session Startup", "Red Lines"]);
|
||||
if (sections.length === 0) {
|
||||
sections = extractSections(content, ["Every Session", "Safety"]);
|
||||
}
|
||||
|
||||
if (sections.length === 0) {
|
||||
return "";
|
||||
|
||||
Reference in New Issue
Block a user