Repository navigation
fix(scheduler): apply the heartbeat receipt fence to Python follow-ups #8606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
GZY-SUPER-HACKER
wants to merge
5
commits into
loopx-project:main
from
GZY-SUPER-HACKER:fix/scheduler-stale-receipt
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a4504eb
fix(scheduler): apply the heartbeat receipt fence to Python follow-ups
GZY-SUPER-HACKER 7eba765
fix(scheduler): keep Python scheduler reads from migrating legacy state
GZY-SUPER-HACKER d47cdfe
fix(scheduler): keep identity-less quota audits from expiring a receipt
GZY-SUPER-HACKER e2237cc
fix(scheduler): scope heartbeat receipt scans to one Goal instance
GZY-SUPER-HACKER 983fdec
fix(scheduler): bind the origin receipt scope into generated follow-ups
GZY-SUPER-HACKER File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ import { | |
| effectRuntimeErrorPayload, | ||
| EffectRuntimeRequestError, | ||
| } from "../effect_runtime_errors.ts"; | ||
| import { requireJsonObject } from "../runtime_decode.ts"; | ||
| import { jsonObject, requireJsonObject } from "../runtime_decode.ts"; | ||
| import { isSupportedNodeVersion } from "../runtime/node_version.ts"; | ||
| import { | ||
| evaluateSchedulerHeartbeatFollowup, | ||
|
|
@@ -214,6 +214,12 @@ function requestFromArgs(argv: string[]): { request: Record<string, unknown>; fo | |
| const facts = requireJsonObject(hint.host_facts, "host_facts"); | ||
| matchingText(facts, "goal_id", parsed.goal_id, "--goal-id"); | ||
| matchingText(facts, "agent_id", parsed.agent_id, "--agent-id"); | ||
| // The origin receipt's scope travels with the facts it was generated for. | ||
| // Passing it into the transaction is what keeps the pre-flight check and the | ||
| // in-lock recheck on that receipt instead of resolving the bare Turn id again. | ||
| const goalRef = jsonObject(facts.goal_ref); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] 拒绝格式无效的显式 GoalRef。 File 和 SQLite 上,省略字段的兼容回报返回成功。显式格式无效的回报也返回成功,并创建调度状态。结构正确但没有匹配回执时,两种后端均拒绝写入。 按字段是否存在区分旧包和显式引用。让原生入口把显式值交给现有 GoalRef 解码与匹配规则,任何形状错误都在写入前返回结构化错误。 |
||
| if (goalRef !== null) | ||
| matchingText(goalRef, "goal_id", parsed.goal_id, "--goal-id"); | ||
| const expectedOperation = parsed.command === "scheduler-ack-current" | ||
| ? "ack" | ||
| : "host_failure"; | ||
|
|
@@ -291,6 +297,7 @@ function requestFromArgs(argv: string[]): { request: Record<string, unknown>; fo | |
| runtime_root: parsed.runtime_root, | ||
| turn_instance_id: parsed.turn_instance_id, | ||
| require_heartbeat_receipt: true, | ||
| ...(goalRef === null ? {} : { goal_ref: goalRef }), | ||
| before: hint.before ?? {}, | ||
| use_current_hint: hint.use_current_hint ?? expectedOperation === "ack", | ||
| reason_summary: values["--reason-summary"] ?? null, | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] 另一 Goal 实例的回执会使有效调度回报过期。 先用真实 should-run 准入旧格式 Turn,再在同名 Goal 和同 Agent 的共享日志里加入另一 Goal 实例的有效回执。重试原 ACK 或失败回报。 仅增加一条带其他 GoalRef 的回执,File 与 SQLite 的 ACK 和失败回报均从正常写入变为 heartbeat_receipt_stale。原回执仍在,重试也无法写回。相同条件下基线写入;同范围真实后继应当继续拒绝。 让 Python 把原回执作用域带到原生传输,或由原生从已匹配的原回执推导其作用域。用同一个类型化作用域判断过滤查找与替代,并在提交锁内复验。旧格式只和同类回执比较,精确 GoalRef 只和同一实例比较。