Skip to content

chore(clients): add CHECKPOINT_TOPIC constant to mempal-fast.py#14

Open
jphein wants to merge 1 commit intorboarescu:mainfrom
jphein:chore/mempal-fast-checkpoint-topic-constant
Open

chore(clients): add CHECKPOINT_TOPIC constant to mempal-fast.py#14
jphein wants to merge 1 commit intorboarescu:mainfrom
jphein:chore/mempal-fast-checkpoint-topic-constant

Conversation

@jphein
Copy link
Copy Markdown
Contributor

@jphein jphein commented Apr 27, 2026

Summary

Adds a CHECKPOINT_TOPIC = \"checkpoint\" constant at the top of clients/mempal-fast.py and replaces the inline \"topic\": \"checkpoint\" in main() with it.

Why

clients/hook.py already declares this constant — see line 39 in current main:

CHECKPOINT_TOPIC = \"checkpoint\"  # keep in sync with main.py and mempal-fast.py — used by kind= search filter

Both hook clients (hook.py and mempal-fast.py) write the same topic value to tool_diary_write. Centralizing it in a per-file constant keeps the canonical name in one place per client rather than scattered as inline strings, so a future rename only touches the two declarations.

The mempal-fast.py side just hadn't been brought into the same shape yet.

Scope

+8 / -1. Single file. No behavior change — same string value gets posted, just sourced from a constant. No new dependencies.

Originally fork commit dd8894c (added the constants to both client files at once); that commit's hook.py half landed via PR #4's cherry-pick, the mempal-fast.py half didn't make it into the final cherry-pick. This brings them in line.

Mirrors the constant already in `clients/hook.py`. Both hook clients
write the same topic value (`"checkpoint"`); centralizing it in a
constant per file keeps the canonical name in one place per client
rather than three inline strings spread across two files.

The clients/hook.py constant has lived in upstream main since
PR #4's cherry-pick (`ef6ac03`). This brings clients/mempal-fast.py
into the same shape — small refactor, no behavior change.

`+8 / -1`. Sending standalone per the "small separate PRs"
preference noted on PR #4.
Copilot AI review requested due to automatic review settings April 27, 2026 19:06
jphein added a commit to jphein/palace-daemon that referenced this pull request Apr 27, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a per-file constant for the checkpoint diary topic in mempal-fast.py, aligning it with the existing pattern in clients/hook.py and removing an inline "checkpoint" string from the request payload.

Changes:

  • Introduce CHECKPOINT_TOPIC = "checkpoint" near the top of clients/mempal-fast.py.
  • Replace the inline "topic": "checkpoint" payload field with "topic": CHECKPOINT_TOPIC.
  • Add explanatory comments documenting why the constant must match clients/hook.py.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants