Skip to content

Feature/update exp effective content#33

Merged
canfuu merged 3 commits intomainfrom
feature/update_exp_effective_content
Mar 3, 2026
Merged

Feature/update exp effective content#33
canfuu merged 3 commits intomainfrom
feature/update_exp_effective_content

Conversation

@canfuu
Copy link
Collaborator

@canfuu canfuu commented Mar 3, 2026

This pull request refactors the logic for generating effective content in the Experience model to improve how content is assembled from multiple sources. Instead of returning either content or the generated code artifact, the method now merges both if available, ensuring more comprehensive and less redundant output.

Content merging logic improvements:

  • The getEffectiveContent method in Experience.java now concatenates both content and the generated content from artifact.code if both are present, separated by a blank line, instead of returning only one or the other. This reduces redundancy and ensures all relevant information is included.

aonebuild and others added 3 commits March 3, 2026 17:55
…/20260303175537479_r_release_1003870_meow-agent-code
更新了`getEffectiveContent()`方法,使其能够将`content`字段和从`artifact.code`生成的内容进行拼接,而不是简单地返回其中一个值。这样可以更好地整合经验的不同部分,提供更完整的信息。

Co-developed-by: Aone Copilot <noreply@alibaba-inc.com>
Copilot AI review requested due to automatic review settings March 3, 2026 12:47
@canfuu canfuu enabled auto-merge March 3, 2026 12:48
Copy link
Collaborator

@shundao shundao left a comment

Choose a reason for hiding this comment

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

LGTM

@canfuu canfuu merged commit 5af9158 into main Mar 3, 2026
3 checks passed
@canfuu canfuu deleted the feature/update_exp_effective_content branch March 3, 2026 12:48
Copy link

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

This PR updates the Experience domain model’s “effective content” assembly to combine user-authored content with code-derived content from artifact.code, so downstream prompt injection can include both sources when available.

Changes:

  • Refactored Experience#getEffectiveContent() to append content first (if present), then append content generated from artifact.code (if present), separated by a blank line.
  • Updated the Javadoc for getEffectiveContent() to reflect the new merge behavior.

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

Comment on lines 149 to +153
if (codeArtifact.getCode() != null && !codeArtifact.getCode().isBlank()) {
return buildContentFromCodeArtifact(codeArtifact);
if (!result.isEmpty()) {
result.append("\n\n");
}
result.append(buildContentFromCodeArtifact(codeArtifact));
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

getEffectiveContent() currently concatenates content and the generated artifact.code block whenever both are present. If existing data already stores the generated block in content (or overlaps heavily), this will duplicate the same guidance and contradict the PR description (“less redundant output”). Consider normalizing and de-duplicating before appending (e.g., compare trimmed/normalized strings, or skip appending when content already contains the generated block). Also consider trimming trailing newlines from content so the \n\n separator doesn’t accidentally introduce multiple blank lines.

Copilot uses AI. Check for mistakes.
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.

3 participants