Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cordis.patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
# are set, this route takes precedence over the foreground Agent model.
llmProvider: !!js process.env.GRAPH_MEMORY_LLM_PROVIDER
llmModel: !!js process.env.GRAPH_MEMORY_LLM_MODEL
llmReasoningEffort: !!js process.env.GRAPH_MEMORY_LLM_REASONING_EFFORT
# Local patch: providers that cannot disable reasoning reject "off"
# (the plugin's built-in default), which quarantines every extraction.
# Fall back to the cheapest declared level unless the env var overrides it.
llmReasoningEffort: !!js "process.env.GRAPH_MEMORY_LLM_REASONING_EFFORT ? process.env.GRAPH_MEMORY_LLM_REASONING_EFFORT : 'low'"
llmMaxTokens: !!js "process.env.GRAPH_MEMORY_LLM_MAX_TOKENS ? Number(process.env.GRAPH_MEMORY_LLM_MAX_TOKENS) : undefined"
# Each committed DSH turn is one extraction job containing only the
# original user question and the final visible assistant answer.
Expand Down
10 changes: 6 additions & 4 deletions dist/dsh.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export function apply(ctx, input = {}) {
id: randomUUID(),
role: "user",
content: [{ type: "text", text: user }],
source: { kind: "plugin", plugin: PLUGIN },
source: { kind: `plugin:${PLUGIN}`, plugin: PLUGIN },
}],
});
for await (const chunk of chunks) {
Expand Down Expand Up @@ -531,9 +531,11 @@ export function apply(ctx, input = {}) {
const visibleMessageIds = new Set(surfaceSeqs.map(seq => `${HOST}:${key}:${String(seq)}`));
const hasArchivedHistory = surfaceSeqs.some(seq => {
const event = immutableEvents?.[seq];
const source = event?.data?.source;
const ownedSource = source?.kind === `plugin:${PLUGIN}`
|| source?.kind === "plugin" && source?.plugin === PLUGIN;
return event?.type === "user/message"
&& event?.data?.source?.kind === "plugin"
&& event?.data?.source?.plugin === PLUGIN
&& ownedSource
&& event?.surfaceOp?.op === "replace";
});
const recalledNodes = filterDshRecallNodes(recalled.nodes, getNodeSources(db, recalled.nodes.map(node => node.id)), currentSession, visibleMessageIds, hasArchivedHistory);
Expand Down Expand Up @@ -562,7 +564,7 @@ export function apply(ctx, input = {}) {
id: randomUUID(),
role: "user",
source: {
kind: "plugin",
kind: `plugin:${PLUGIN}`,
plugin: PLUGIN,
form: "snapshot",
sections: [{ name: "graph-memory:recall", text }],
Expand Down
2 changes: 1 addition & 1 deletion dist/src/format/dsh-compaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function replaceDshArchivedPrefix(session, tokenMeter, range) {
const replacement = session.append("user/message", {
id: `graph-memory-archive:${String(session.id ?? "session")}:${range.start}-${range.end}`,
role: "user",
source: { kind: "plugin", plugin: "graph-memory" },
source: { kind: "plugin:graph-memory", plugin: "graph-memory" },
content: [{ type: "text", text: DSH_ARCHIVE_MARKER }],
}, {
// Match the current DSH Session surface-operation contract exactly.
Expand Down
2 changes: 1 addition & 1 deletion dist/src/format/dsh-turn-projection.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export function replaceDshCompletedTurnTrace(session, tokenMeter, range) {
const replacement = session.append("user/message", {
id: `graph-memory-turn-trace:${String(session.id ?? "session")}:${range.turn}`,
role: "user",
source: { kind: "plugin", plugin: "graph-memory" },
source: { kind: "plugin:graph-memory", plugin: "graph-memory" },
content: [{
type: "text",
text: `<graph-memory-trace turn="${range.turn}">Intermediate tool trace archived; the original question and final answer remain visible.</graph-memory-trace>`,
Expand Down
10 changes: 6 additions & 4 deletions dsh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export function apply(ctx: DshContext, input: Config = {}): void {
id: randomUUID(),
role: "user",
content: [{ type: "text", text: user }],
source: { kind: "plugin", plugin: PLUGIN },
source: { kind: `plugin:${PLUGIN}`, plugin: PLUGIN },
}],
});
for await (const chunk of chunks) {
Expand Down Expand Up @@ -680,9 +680,11 @@ export function apply(ctx: DshContext, input: Config = {}): void {
const visibleMessageIds = new Set(surfaceSeqs.map(seq => `${HOST}:${key}:${String(seq)}`));
const hasArchivedHistory = surfaceSeqs.some(seq => {
const event = immutableEvents?.[seq];
const source = event?.data?.source;
const ownedSource = source?.kind === `plugin:${PLUGIN}`
|| source?.kind === "plugin" && source?.plugin === PLUGIN;
return event?.type === "user/message"
&& event?.data?.source?.kind === "plugin"
&& event?.data?.source?.plugin === PLUGIN
&& ownedSource
&& event?.surfaceOp?.op === "replace";
});
const recalledNodes = filterDshRecallNodes(
Expand Down Expand Up @@ -719,7 +721,7 @@ export function apply(ctx: DshContext, input: Config = {}): void {
id: randomUUID(),
role: "user",
source: {
kind: "plugin",
kind: `plugin:${PLUGIN}`,
plugin: PLUGIN,
form: "snapshot",
sections: [{ name: "graph-memory:recall", text }],
Expand Down
2 changes: 1 addition & 1 deletion src/format/dsh-compaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export function replaceDshArchivedPrefix(
const replacement = session.append("user/message", {
id: `graph-memory-archive:${String(session.id ?? "session")}:${range.start}-${range.end}`,
role: "user",
source: { kind: "plugin", plugin: "graph-memory" },
source: { kind: "plugin:graph-memory", plugin: "graph-memory" },
content: [{ type: "text", text: DSH_ARCHIVE_MARKER }],
}, {
// Match the current DSH Session surface-operation contract exactly.
Expand Down
2 changes: 1 addition & 1 deletion src/format/dsh-turn-projection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export function replaceDshCompletedTurnTrace(
const replacement = session.append("user/message", {
id: `graph-memory-turn-trace:${String(session.id ?? "session")}:${range.turn}`,
role: "user",
source: { kind: "plugin", plugin: "graph-memory" },
source: { kind: "plugin:graph-memory", plugin: "graph-memory" },
content: [{
type: "text",
text: `<graph-memory-trace turn="${range.turn}">Intermediate tool trace archived; the original question and final answer remain visible.</graph-memory-trace>`,
Expand Down