Skip to content

Comments

fix(agent): block interface schema agent to request future schema.#1124

Merged
samchon merged 2 commits intomainfrom
fix/interface-schema-refine-review-prompts
Feb 24, 2026
Merged

fix(agent): block interface schema agent to request future schema.#1124
samchon merged 2 commits intomainfrom
fix/interface-schema-refine-review-prompts

Conversation

@samchon
Copy link
Member

@samchon samchon commented Feb 24, 2026

This pull request updates the agent prompt documentation and configuration to clarify and enforce the correct use of the getInterfaceSchemas request, ensuring agents do not attempt to fetch schemas for types that do not yet exist. It also reduces the validation retry limit for schema validation. The changes improve prompt accuracy, prevent unnecessary or erroneous requests, and clarify the agent workflow for handling $ref targets.

Prompt documentation improvements:

  • Clarified that getInterfaceSchemas only returns existing schemas, and agents should never request types they intend to create via $ref; if a type does not exist, the failure is expected and should not be retried. This guidance was added to all relevant prompt markdown files, including INTERFACE_SCHEMA_CASTING.md, INTERFACE_SCHEMA_COMPLEMENT.md, INTERFACE_SCHEMA_CONTENT_REVIEW.md, INTERFACE_SCHEMA_REFINE.md, and INTERFACE_SCHEMA_RELATION_REVIEW.md. [1] [2] [3] [4] [5]

  • Updated checklist sections in the prompt files to add explicit reminders not to call getInterfaceSchemas for types that do not yet exist or are being created. [1] [2] [3] [4] [5]

  • Added a note to INTERFACE_SCHEMA_SECURITY_REVIEW.md clarifying that $ref does not require the target type to exist, as another agent will create missing targets later, and updated the checklist accordingly. [1] [2]

Configuration change:

  • Reduced the VALIDATION_RETRY constant from 8 to 5 in AutoBeConfigConstant, reflecting a new balance between validation robustness and latency.

@samchon samchon self-assigned this Feb 24, 2026
@samchon samchon added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Feb 24, 2026
@samchon samchon added this to WrtnLabs Feb 24, 2026
@samchon samchon marked this pull request as ready for review February 24, 2026 03:49
Copilot AI review requested due to automatic review settings February 24, 2026 03:49
Copy link
Contributor

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

Updates AutoBE agent prompts and configuration to prevent agents from requesting interface schemas for types that do not yet exist (e.g., future $ref targets), and reduces the default validation retry count to lower latency while maintaining correction capability.

Changes:

  • Reduced default validation retry attempts from 8 → 5 via AutoBeConfigConstant.VALIDATION_RETRY.
  • Added consistent prompt guidance across interface-schema agents: getInterfaceSchemas returns only existing schemas; do not request types that are being newly created via $ref and do not retry “non-existent schema” failures.
  • Extended/standardized preliminary-request checklists to explicitly prohibit requesting non-existent schemas.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/agent/src/constants/AutoBeConfigConstant.ts Lowers default validation retry count to reduce correction-loop latency.
packages/agent/prompts/INTERFACE_SCHEMA_SECURITY_REVIEW.md Adds explicit getInterfaceSchemas usage rules and checklist reminder.
packages/agent/prompts/INTERFACE_SCHEMA_RELATION_REVIEW.md Adds getInterfaceSchemas “existing-only” rules + checklist item.
packages/agent/prompts/INTERFACE_SCHEMA_REFINE.md Adds getInterfaceSchemas “existing-only” rules + checklist item.
packages/agent/prompts/INTERFACE_SCHEMA_CONTENT_REVIEW.md Splits prelim request guidance into bullets and adds “existing-only” rule + checklist item.
packages/agent/prompts/INTERFACE_SCHEMA_COMPLEMENT.md Reworks prelim guidance bullets and adds “existing-only” rule + checklist item.
packages/agent/prompts/INTERFACE_SCHEMA_CASTING.md Splits prelim request guidance into bullets and adds “existing-only” rule + checklist item.

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

- NEVER re-request already loaded materials — empty array = exhausted
- `getInterfaceSchemas` only returns existing schemas
- NEVER request a type you intend to newly create via `$ref` — it does not exist yet
- If the call fails with "non-existing", the failure is correct — do not retry
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

This bullet mentions the call failing with "non-existing", but the validator’s error message for unknown interface schemas is phrased as "NON-EXISTING interface schema name" (not "non-existing"). Consider updating this wording (or making it substring-agnostic) so agents can reliably map the instruction to the real feedback.

Suggested change
- If the call fails with "non-existing", the failure is correct — do not retry
- If the call fails with an error containing "NON-EXISTING interface schema name", the failure is correct — do not retry

Copilot uses AI. Check for mistakes.
- Never re-request loaded materials
- `getInterfaceSchemas` only returns existing schemas
- NEVER request a type you intend to newly create via `$ref` — it does not exist yet
- If the call fails with "non-existing", the failure is correct — do not retry
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The prompt anchors on an error string "non-existing" for getInterfaceSchemas, but the system validation error is worded as "NON-EXISTING interface schema name". Adjusting this (or avoiding quoting a specific substring) will keep the prompt aligned with the actual validator feedback.

Suggested change
- If the call fails with "non-existing", the failure is correct — do not retry
- If the call fails because the schema does not exist, the failure is correct — do not retry

Copilot uses AI. Check for mistakes.
- Empty array response → That type exhausted, move to complete
- `getInterfaceSchemas` only returns existing schemas
- NEVER request a type you intend to newly create via `$ref` — it does not exist yet
- If the call fails with "non-existing", the failure is correct — do not retry
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

This instruction references an error string "non-existing". In code, invalid getInterfaceSchemas requests produce a validation error that starts with "You've referenced a NON-EXISTING interface schema name". Consider updating the wording (or generalizing it) to match the actual feedback agents will see.

Suggested change
- If the call fails with "non-existing", the failure is correct — do not retry
- If the call fails with a validation error about a non-existing interface schema name (e.g., "You've referenced a NON-EXISTING interface schema name"), the failure is correct — do not retry

Copilot uses AI. Check for mistakes.
- Never re-request loaded materials
- `getInterfaceSchemas` only returns existing schemas
- NEVER request a type you intend to newly create via `$ref` — it does not exist yet
- If the call fails with "non-existing", the failure is correct — do not retry
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The prompt says the call fails with "non-existing", but the actual validator message for unknown schema names is "NON-EXISTING interface schema name". Please update the quoted wording (or avoid quoting a specific token) so the instruction matches the feedback agents receive.

Suggested change
- If the call fails with "non-existing", the failure is correct — do not retry
- If the call fails with a "NON-EXISTING interface schema name" error, the failure is correct — do not retry

Copilot uses AI. Check for mistakes.
- Never re-request loaded materials
- `getInterfaceSchemas` only returns existing schemas
- NEVER request a type you intend to newly create via `$ref` — it does not exist yet
- If the call fails with "non-existing", the failure is correct — do not retry
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The prompt states the call fails with "non-existing", but the underlying validation error for unknown interface schema names is worded as "NON-EXISTING interface schema name". Consider aligning this wording (or making it more general) so agents don’t look for a string that won’t appear verbatim.

Suggested change
- If the call fails with "non-existing", the failure is correct — do not retry
- If the call fails with an error indicating a non-existing interface schema name (for example, "NON-EXISTING interface schema name"), the failure is correct — do not retry

Copilot uses AI. Check for mistakes.
@samchon samchon merged commit c3452db into main Feb 24, 2026
11 checks passed
@samchon samchon deleted the fix/interface-schema-refine-review-prompts branch February 24, 2026 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant