Skip to content

feat: compact summary-first output for GH AW truncation resilience#4

Merged
sergio-sisternes-epam merged 13 commits intomainfrom
feat/compact-summary
Mar 6, 2026
Merged

feat: compact summary-first output for GH AW truncation resilience#4
sergio-sisternes-epam merged 13 commits intomainfrom
feat/compact-summary

Conversation

@danielmeppiel
Copy link
Collaborator

Problem

GH Agentic Workflows truncates each agent text block to 500 characters in the step summary (generateCopilotCliStyleSummary in log_parser_shared.cjs). When the Copilot CLI agent tries to write a deployment table to $GITHUB_STEP_SUMMARY and fails (the env var points to a nonexistent file inside the awf sandbox), the agent's error recovery text consumes ~40% of the 500-char budget. Result: only 1 out of 7 table rows survives truncation.

Solution

Output a compact headline first, before per-file details:

APM: 5 primitives deployed (2 prompts, 1 agent, 2 skills) + AGENTS.md

This single line (~70 chars) always survives truncation, giving users the key deployment info regardless of how many primitives are installed. The per-file details follow after for runs where space permits.

Changes

  • listDeployed() now collects counts before emitting output
  • Compact headline is emitted first (truncation-resilient)
  • Per-file details follow (may be truncated — that's OK)
  • Filters hidden files (. prefix) from counts
  • AGENTS.md check folded into the headline instead of a separate line

Context

See the truncation root cause analysis in the GH AW codebase:

  • log_parser_shared.cjs line ~1270: const maxTextLength = 500;
  • log_parser_bootstrap.cjs: generateCopilotCliStyleSummary()core.summary.addRaw().write()
  • $GITHUB_STEP_SUMMARY is inherited from the runner but the file doesn't exist inside the awf sandbox filesystem

Output a single headline (e.g. 'APM: 5 primitives deployed (2 prompts, 1 agent, 2 skills)')
before per-file details. The headline survives GH AW's 500-char per-text-block
truncation in generateCopilotCliStyleSummary, ensuring the key info is always
visible in the step summary even when detailed file lists are cut off.
- README.md with usage, inputs/outputs, third-party deps, trademark notice
- LICENSE (MIT), CONTRIBUTING.md (CLA), CODE_OF_CONDUCT.md, SUPPORT.md, SECURITY.md (existed)
- CI workflow: build (typecheck/lint/test/build/dist-check) + 3 integration tests + release
- ESLint flat config + Jest/ts-jest setup
- Integration tests cover: manifest install, skip-manifest, compile flag
The .d.ts.map files contain absolute local paths, causing dist/
to always differ between local and CI environments.
declarationMap generates absolute local paths that differ between
local and CI environments. Disabled in tsconfig, gitignored, and
excluded from the CI diff check.
Per-primitive paths (e.g. microsoft/apm-sample-package/instructions/X)
fail because APM looks for a subdirectory, but primitives live under
.apm/. Use full package install instead and verify deployed files.
Per-primitive install requires .apm/ prefix to reach the actual
primitive files. test-manifest installs the full package; test-skip-manifest
creates an apm.yml with an agent but installs only a skill inline,
proving the manifest is truly skipped.
The repo has its own .github/agents/agentic-workflows.agent.md which
was being matched by the wildcard *.agent.md check. Look for the
specific design-reviewer.agent.md from the test manifest instead.
When skip-manifest is true, remove .github/{instructions,agents,skills,prompts}
before installing inline deps. This guarantees a clean primitive set with no
contamination from pre-existing, unmanaged files in .github/.
'isolated' better describes the intent: clear all pre-existing
primitives in .github/ and install only the inline dependencies
into a clean environment. No manifest to 'skip' in this scenario.
Also fix stale skip-manifest references in test-action.yml → isolated.
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 improves the action’s log output resilience under GH Agentic Workflows’ 500-character step-summary truncation by emitting a compact deployment headline before verbose per-file details, while also introducing an isolated install mode and adding project tooling/docs/CI support.

Changes:

  • Emit a compact “APM: … primitives deployed …” headline first in listDeployed(), followed by per-file details (which may be truncated).
  • Replace skip-manifest behavior with a new isolated mode that clears existing primitive directories and installs only inline dependencies.
  • Add CI workflow, ESLint/Jest configuration, and standard repository documentation files.

Reviewed changes

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

Show a summary per file
File Description
tsconfig.json Stops producing declaration map files by removing declarationMap.
src/runner.ts Adds isolated mode primitive cleanup and summary-first deployed output formatting.
package.json Adds ESLint + Jest/ts-jest dev dependencies to support linting/testing in CI.
jest.config.mjs Introduces Jest config for TypeScript tests via ts-jest.
eslint.config.mjs Adds ESLint flat config for TypeScript sources.
dist/runner.d.ts.map Removes generated declaration map artifact from dist.
dist/runner.d.ts Updates generated typings banner text to reference isolated.
dist/main.d.ts.map Removes generated declaration map artifact from dist.
dist/installer.d.ts.map Removes generated declaration map artifact from dist.
dist/index.js Updates compiled/bundled action output to match src/ changes.
action.yml Replaces skip-manifest input with isolated input and updated description.
SUPPORT.md Adds standard support guidance for issues/discussions.
README.md Adds usage docs including isolated mode and inputs/outputs tables.
LICENSE Adds MIT license file.
CONTRIBUTING.md Adds contribution and local dev workflow instructions.
CODE_OF_CONDUCT.md Adds Microsoft OSS Code of Conduct notice.
CODEOWNERS Adds repository code ownership configuration.
.gitignore Ignores dist/*.d.ts.map artifacts.
.github/workflows/ci.yml Adds CI for typecheck/lint/test/build, dist verification, and integration tests (manifest/isolated/compile).

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

- Guard clearPrimitives with GITHUB_WORKSPACE boundary check
- Fix isolated mode description to match actual behavior (clears primitive dirs, not all of .github/)
- Surface AGENTS.md in listDeployed when zero primitives found
- Plant explicit pre-existing primitives in CI test-isolated job
Sets contents: read as default for all jobs. The release job
already overrides with contents: write.

Addresses code-scanning alerts #4-#7.
@sergio-sisternes-epam sergio-sisternes-epam merged commit 9700865 into main Mar 6, 2026
9 checks passed
@sergio-sisternes-epam sergio-sisternes-epam deleted the feat/compact-summary branch March 6, 2026 08:25
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