This is an automated email from the ASF dual-hosted git repository.
zclllyybb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 90db340515e [improvement](CI) Support centralized memory consolidation
and reuse (#64665)
90db340515e is described below
commit 90db340515e88e177bc4e6151ba0b9a84cf04d8c
Author: zclllyybb <[email protected]>
AuthorDate: Mon Jun 22 14:47:09 2026 +0800
[improvement](CI) Support centralized memory consolidation and reuse
(#64665)
Support collecting session data from the pipeline machine, organize it
into memory, and reuse it in subsequent reviews.
Principle of change: https://github.com/openai/codex/issues/29318
Backend service:
https://github.com/zclllyybb/codex/tree/codex-memory-maintain-command
Verification: https://github.com/zclllyybb/doris/pull/50
---
.github/workflows/code-review-runner.yml | 53 ++++++++++++++++++++++----------
1 file changed, 37 insertions(+), 16 deletions(-)
diff --git a/.github/workflows/code-review-runner.yml
b/.github/workflows/code-review-runner.yml
index c6bcced9774..394f4173519 100644
--- a/.github/workflows/code-review-runner.yml
+++ b/.github/workflows/code-review-runner.yml
@@ -141,27 +141,37 @@ jobs:
OSS_CODEX_AUTH_OBJECT: oss://doris-community-ci/codex/auth.json
- name: Sync Codex memories from OSS
- continue-on-error: true
run: |
install -m 700 -d "$CODEX_HOME/memories"
archive="$RUNNER_TEMP/codex-memories.tar.gz"
+ listing="$RUNNER_TEMP/codex-memories.list"
if ossutil -i "$OSS_AK" -k "$OSS_SK" -e "$OSS_ENDPOINT" cp -f
"$OSS_CODEX_MEMORIES_OBJECT" "$archive"; then
- tar -tzf "$archive" | awk '
- $0 != "memories" && $0 !~ /^memories\// { bad = 1 }
- END { exit bad }
- '
- tar -xzf "$archive" -C "$CODEX_HOME"
- install -m 700 -d "$CODEX_HOME/memories"
- chmod -R go-rwx "$CODEX_HOME/memories" || true
+ if [ -s "$archive" ]; then
+ tar -tzf "$archive" > "$listing"
+ if [ -s "$listing" ]; then
+ awk '
+ $0 != "memories" && $0 != "memories/" && $0 !~ /^memories\//
{ bad = 1 }
+ END { exit bad }
+ ' "$listing"
+ tar -xzf "$archive" -C "$CODEX_HOME"
+ else
+ echo "Codex memories archive is empty; continuing with empty
memories."
+ fi
+ else
+ echo "Codex memories archive is empty; continuing with empty
memories."
+ fi
else
echo "No Codex memories archive could be downloaded; continuing
with empty memories."
fi
+ install -m 700 -d "$CODEX_HOME/memories"
+ touch "$CODEX_HOME/memories/memory_summary.md"
+ chmod -R go-rwx "$CODEX_HOME/memories" || true
env:
OSS_AK: ${{ secrets.OSS_AK }}
OSS_SK: ${{ secrets.OSS_SK }}
OSS_ENDPOINT: oss-cn-hongkong.aliyuncs.com
- OSS_CODEX_MEMORIES_OBJECT:
oss://doris-community-ci/codex/memories.tar.gz
+ OSS_CODEX_MEMORIES_OBJECT: oss://doris-community-ci/memories.tar.gz
- name: Prepare review context directory
run: |
@@ -557,23 +567,34 @@ jobs:
--verify-sleep-seconds 5 \
--verify
- - name: Sync Codex memories back to OSS
+ - name: Sync Codex sessions back to OSS
if: ${{ always() }}
continue-on-error: true
run: |
- if [ ! -d "$CODEX_HOME/memories" ]; then
- echo "No Codex memories directory found; skipping memories sync."
+ if [ ! -d "$CODEX_HOME/sessions" ]; then
+ echo "No Codex sessions directory found; skipping session sync."
exit 0
fi
- archive="$RUNNER_TEMP/codex-memories.tar.gz"
- tar -C "$CODEX_HOME" -czf "$archive" memories
- ossutil -i "$OSS_AK" -k "$OSS_SK" -e "$OSS_ENDPOINT" cp -f
"$archive" "$OSS_CODEX_MEMORIES_OBJECT"
+ uploaded=0
+ skipped=0
+ while IFS= read -r -d '' session_file; do
+ rel="${session_file#"$CODEX_HOME/sessions/"}"
+ remote="${OSS_CODEX_SESSION_PREFIX%/}/$rel"
+ if ossutil -i "$OSS_AK" -k "$OSS_SK" -e "$OSS_ENDPOINT" stat
"$remote" >/dev/null 2>&1; then
+ skipped=$((skipped + 1))
+ continue
+ fi
+ ossutil -i "$OSS_AK" -k "$OSS_SK" -e "$OSS_ENDPOINT" cp -f
"$session_file" "$remote"
+ uploaded=$((uploaded + 1))
+ done < <(find "$CODEX_HOME/sessions" -type f -name '*.jsonl' -print0)
+
+ echo "Uploaded $uploaded new Codex session file(s); skipped $skipped
existing file(s)."
env:
OSS_AK: ${{ secrets.OSS_AK }}
OSS_SK: ${{ secrets.OSS_SK }}
OSS_ENDPOINT: oss-cn-hongkong.aliyuncs.com
- OSS_CODEX_MEMORIES_OBJECT:
oss://doris-community-ci/codex/memories.tar.gz
+ OSS_CODEX_SESSION_PREFIX: oss://doris-community-ci/session
- name: Sync Codex auth back to OSS
if: ${{ always() }}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]