Skip to content

feat: add bounded local Agent smoke mode - #288

Merged
DavidHLP merged 4 commits into
mainfrom
codex/agent-manual-smoke-guard
Oct 12, 2026
Merged

DavidHLP merged 4 commits into
mainfrom
codex/agent-manual-smoke-guard

Conversation

@DavidHLP

@DavidHLP DavidHLP commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Fix the manual sourced-analysis boundary so normal inline complexity formatting is accepted while uncited source lines remain rejected.
  • Add privacy-safe failure diagnostics that log only the analysis stage and an allowlisted reason code.
  • Clear stale receipt.failureReason after successful analysis and hide legacy stale failure values when a successful analysis is already persisted.
  • Synchronize the Agent runbook and repository corpus manifest.

Verification

  • uv run pytest -q tests/test_agent_service.py::test_offline_analyze_resumes_same_graph_and_cas_persists_answer — passed.
  • uv run pytest -q tests/test_repository_corpus.py tests/test_corpus_manifest.py — 67 passed.
  • Local real-provider analysis returned HTTP 200 and persisted an awaiting_confirmation draft with citation verification; reloading shows the successful status without a stale failure indicator.
  • GitHub Actions run 38248924330 for this head completed with 22 successful jobs, 2 path-conditional skips (Contract Compatibility and Frontend), and no failures.
  • The PR was merged into main as 3b3a6439d40eacf27a06594cca91483488b8583f.
  • This manual local run does not establish formal U02/U03/U04 acceptance or Java save-path acceptance. Manual mode remains analysis-only.

Related: DAV-58.

@DavidHLP
DavidHLP marked this pull request as ready for review October 12, 2026 12:26
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T12:35:27.082432Z 0e4aab1 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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: 0e4aab1053

ℹ️ 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 +1052 to +1054
citations = [
{**citation, "text": "源码片段已核验,仅用于本次分析"}
for citation in citations

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 Redact cited source excerpts from the answer too

When the model repeats a cited source excerpt in parsed["text"], _verify_answer_boundary removes that citation text from reference_text before checking for leaked source lines, so the answer passes. These lines redact only the citation object; the unredacted answer is then persisted in both draft.content and analysis.answer, violating the manual mode's promise not to store submission-source excerpts. Reject source text appearing in the answer or redact it before either field is stored.

Useful? React with 👍 / 👎.

Comment on lines +645 to +646
if len(code) > MAX_MANUAL_SOURCE_CHARS:
raise AgentError(413, "source_too_large", 41300)

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 Apply the prompt limit before the first model call

For source containing multibyte characters or many JSON-escaped characters, len(code) <= 12_000 can pass even though the serialized tool result exceeds DeepseekModel's 24,000-byte prompt estimate. Because the source is added only after the model's first tool-request turn, that first paid request is dispatched and reserved before the second turn rejects the oversized prompt, so an accepted submission within the documented source limit cannot be analyzed and still consumes budget. Preflight the serialized source tool result or enforce a compatible UTF-8/JSON byte limit before starting the graph.

Useful? React with 👍 / 👎.

Comment on lines +38 to +39
"limit_micro_usd": 182_000_000,
"attempts": 18_000,

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 Include the still-usable V20 allowance in the cumulative cap

The new $182 allowance is calculated from V20's historical committed and unresolved amounts only, but the V20 period itself still has an independent $2.885422 budget and this setup neither accounts for its current usage nor halts it. Consequently, if V20 remains active, the old liabilities plus both usable allowances total $202.269632, and consuming more than $0.615790 from V20 alongside this manual period can exceed the stated $200 cumulative authorization. Bind preparation to the live V20 snapshot and remaining cumulative headroom, or retire that allowance before activating this one.

Useful? React with 👍 / 👎.

@DavidHLP
DavidHLP merged commit 3b3a643 into main Oct 12, 2026
25 checks passed
@DavidHLP
DavidHLP deleted the codex/agent-manual-smoke-guard branch October 12, 2026 12:39
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