Skip to content

Commit ab16ac5

Browse files
committed
fix: filter Codex command marker noise
Jieli-Thread: http://127.0.0.1:8080/threads/T-019ec058-99fd-75e0-b0fa-104e33f49a5c
1 parent f211abe commit ab16ac5

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

plugins/codex/.codex-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jieli",
3-
"version": "0.1.20",
3+
"version": "0.1.21",
44
"description": "Sync Codex sessions to Jieli threads and attach Jieli thread trailers to Codex-created commits.",
55
"author": {
66
"name": "Jieli"

plugins/codex/scripts/jieli_node.mjs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,19 @@ function truncateToolOutput(text, maxChars = TOOL_OUTPUT_MAX_CHARS) {
717717
function shouldSkipUserMessage(content) {
718718
const text = textFromContent(content).trimStart();
719719
if (!text) return true;
720-
return ["<codex_internal_context", "<turn_aborted", "<skill>", "Base directory for this skill:", "# AGENTS.md instructions for "].some((prefix) => text.startsWith(prefix));
720+
return [
721+
"<codex_internal_context",
722+
"<turn_aborted",
723+
"<command-name>",
724+
"<command-message>",
725+
"<command-args>",
726+
"<local-command-stdout>",
727+
"<local-command-stderr>",
728+
"<local-command-caveat>",
729+
"<skill>",
730+
"Base directory for this skill:",
731+
"# AGENTS.md instructions for ",
732+
].some((prefix) => text.startsWith(prefix));
721733
}
722734

723735
function isEnvironmentContextText(text) {

plugins/codex/tests/runtime-node.test.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ test("filters Codex handoff summaries, git directives, internal context, loaded
233233
{ type: "session_meta", payload: { id: "codex-filter", cwd: "/Users/alice/work/jieli" } },
234234
{ type: "response_item", payload: { type: "message", role: "user", content: [{ type: "input_text", text: "<codex_internal_context>resume</codex_internal_context>" }] } },
235235
{ type: "response_item", payload: { type: "message", role: "user", content: [{ type: "input_text", text: "<turn_aborted></turn_aborted>" }] } },
236+
{ type: "response_item", payload: { type: "message", role: "user", content: [{ type: "input_text", text: "<command-name>/plugin</command-name>\n<command-message>plugin</command-message>\n<command-args></command-args>" }] } },
237+
{ type: "response_item", payload: { type: "message", role: "user", content: [{ type: "input_text", text: "<local-command-stdout>(no content)</local-command-stdout>" }] } },
236238
{ type: "response_item", payload: { type: "message", role: "user", content: [{ type: "input_text", text: windowsEnvironmentContext }] } },
237239
{ type: "response_item", payload: { type: "message", role: "user", content: [{ type: "input_text", text: agentsBlock }] } },
238240
{ type: "response_item", payload: { type: "message", role: "user", content: [{ type: "input_text", text: skillBlock }] } },
@@ -256,7 +258,7 @@ test("filters Codex handoff summaries, git directives, internal context, loaded
256258
assert.equal(payload.thread.title, "threads list, hidden branch name, just show repo");
257259
assert.equal(Object.hasOwn(payload.thread, "metadata"), false);
258260
const raw = JSON.stringify(payload);
259-
assert.doesNotMatch(raw, /<environment_context>|codex_internal_context|turn_aborted|AI AGENT PROTOCOLS|Spec-Driven Planning|Files mentioned by the user|codex-clipboard|do not upload this summary|compacted implementation detail|::git-/);
261+
assert.doesNotMatch(raw, /<environment_context>|codex_internal_context|turn_aborted|command-name|command-message|command-args|local-command-stdout|AI AGENT PROTOCOLS|Spec-Driven Planning|Files mentioned by the user|codex-clipboard|do not upload this summary|compacted implementation detail|::git-/);
260262
});
261263

262264
test("normalizes Codex repo metadata, data URL images, local image events, and attachment cache", async () => {

0 commit comments

Comments
 (0)