feat: support invocation-scoped GenAI identity - #288
Conversation
| expect(opencode).toEqual(canonical); | ||
| expect(openclaw).toEqual(canonical); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
[Medium] INVOCATION_IDENTITY_FIELD_MAP is duplicated in 4 files with no sync test to guard against drift.
影响: A future edit (e.g. adding a third identity key) could update one copy but miss the others, silently breaking identity passthrough for that agent with no CI signal. The existing RESERVED_PREFIXES sync test in this same file (which this PR correctly extended for openclaw) demonstrates the project expects drift guards for duplicated constants.
建议: Add a sibling test describe('invocation identity field map stays in sync across copies') that extracts the map from all 4 locations and asserts equality:
assets/hooks/shared/resource-context.mjs(lines 23-26)assets/plugins/openclaw/plugin.mjs(lines 60-63)assets/plugins/opencode/plugin.mjs(lines 63-66)src/normalization/invocation-identity.ts(lines 13-14, constants)
Generated by LoongSuite-Pilot Code Review Agent
🔍 Code Review Summary
Lifecycle Verdict
Merge Gate(合入门禁)APPROVE-READY ✅ No Critical, High, or blocking Medium issues. The one Medium finding (F1: missing sync test for Findings Summary
总体结论Well-designed feature with clean transport-field separation, defense-in-depth reserved-key blocking, and comprehensive test coverage (130+ targeted tests). The Recommendation: Merge as-is, address F1 (sync test) as a fast-follow. Highlights(正向实践)
评审报告详见: |
linrunqi08
left a comment
There was a problem hiding this comment.
✅ Medium/High 及以上问题已全部确认为非阻断项(F1 是测试覆盖建议,当前 4 份副本一致),本轮评审通过(approved)。
建议合入后补充 INVOCATION_IDENTITY_FIELD_MAP 的同步测试作为 fast-follow。
Summary
Validation
Closes #287