Skip to content

fix: address Codex review from #148 (3 P1 + 1 P2)#149

Closed
VictorGjn wants to merge 4 commits intomasterfrom
fix/codex-review-p1
Closed

fix: address Codex review from #148 (3 P1 + 1 P2)#149
VictorGjn wants to merge 4 commits intomasterfrom
fix/codex-review-p1

Conversation

@VictorGjn
Copy link
Copy Markdown
Owner

Codex Review Fixes

Addresses all 4 issues flagged by Codex on PR #148 (now merged).

# Severity File Fix
1 P1 PromptRouter.ts Regex s\s for whitespace splitting
2 P1 ReactiveCompaction.ts Iterate 0..half (least relevant) instead of half..end (most relevant)
3 P1 reactivePackerWrapper.ts Truncate content proportionally after depth adjustment
4 P2 agentSearchIntegration.ts Include description+role+tags in cache key hash

- Fix PromptRouter regex: \s not s for whitespace splitting
- Fix ReactiveCompaction: downgrade least-relevant half, not most-relevant
- Fix reactivePackerWrapper: truncate content after depth adjustment
- Fix agentSearchIntegration: include metadata in cache key for freshness
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1eee49d9fe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +134 to +135
? contentStr.slice(0, truncatedLength) + '
[... truncated by reactive compaction]'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Escape newline in reactive truncation marker

This string literal contains a raw line break between opening and closing quotes, which makes reactivePackerWrapper.ts fail to parse (TS1002: Unterminated string literal) and blocks builds/imports that touch this module. Use an escaped newline (for example \n) or a template literal so compaction can run without syntax errors.

Useful? React with 👍 / 👎.

knowledge: KnowledgeSource[] = [],
): AgentSearchService {
const hash = JSON.stringify(agents.map(a => a.id).sort());
const hash = JSON.stringify(agents.map(a => [a.id, a.description, a.role, ...(a.tags ?? [])].join('|')).sort());
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep cache hash format consistent after reindex

This hash now includes description/role/tags, but reindex() still writes _lastIndexHash using only agent IDs, so the next createAgentSearchService() call will always see a mismatch and rebuild the index even when nothing changed. That effectively disables the intended cache fast path after any reindex() call and adds avoidable reindex cost.

Useful? React with 👍 / 👎.

- Fix unterminated string literal: escape newline in truncation marker
- Fix reindex() hash: use same format as createAgentSearchService()
All join('\n') calls had raw newlines instead of escaped.
Fixes TS1002 Unterminated string literal in 3 files.
Fixes .join('\n\n') double-newline patterns that also had raw newlines.
@VictorGjn VictorGjn closed this Apr 3, 2026
@VictorGjn
Copy link
Copy Markdown
Owner Author

Closing: all 4 fixes (3 P1 + 1 P2) are already present on master. Verified each one:

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.

1 participant