Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

feat(cli): improve logging system with trace file support and fixes#84

Open
jlevy wants to merge 30 commits intomain from
claude/review-merge-cli-logging-HznVa
Open

feat(cli): improve logging system with trace file support and fixes #84
jlevy wants to merge 30 commits intomain from
claude/review-merge-cli-logging-HznVa

Conversation

@jlevy
Copy link
Owner

@jlevy jlevy commented Jan 5, 2026
edited
Loading

Summary

This PR builds on the logging improvements from PR #73, adding additional enhancements and fixes based on a senior engineering review:

  • Add --trace <file> flag for incremental file logging during execution (all fill-related commands)
  • Add MARKFORM_TRACE env var support for trace file
  • Increase DEBUG_OUTPUT_TRUNCATION_LIMIT from 500 to 2000 chars (configurable via MARKFORM_DEBUG_TRUNCATION_LIMIT)
  • Fix run.ts to pass model info to createFillLoggingCallbacks for consistent output
  • Add traceFile support to research.ts and fill.ts callbacks
  • Document logging system review findings in docs/project/specs/active/review-2026年01月04日-cli-logging-system.md

Trace File Feature

The trace file feature allows monitoring long-running fills by writing log output incrementally to a file (without ANSI colors). This is useful for:

  • Debugging long-running form fills
  • Post-hoc analysis of execution
  • Monitoring progress when running in background

Usage:

markform fill examples/movie-research/movie-research-demo.form.md \
 --model openai/gpt-5-mini \
 --trace /tmp/fill-trace.log

Or via environment variable:

MARKFORM_TRACE=/tmp/trace.log markform fill ...

Files Changed

  • src/cli/cli.ts - Added --debug and --trace global flags
  • src/cli/lib/cliTypes.ts - Added LogLevel type, debug property, traceFile to CommandContext
  • src/cli/lib/shared.ts - Added logDebug function, computeLogLevel helper, traceFile extraction
  • src/cli/lib/fillLogging.ts - Enhanced with LogLevel support, structured tool info, trace file support
  • src/cli/commands/fill.ts - Added trace file support with createTracer helper
  • src/cli/commands/research.ts - Added traceFile support to callbacks
  • src/cli/commands/run.ts - Added traceFile support to callbacks
  • src/settings.ts - Increased DEBUG_OUTPUT_TRUNCATION_LIMIT to 2000
  • tests/cli/commands.tryscript.md - Updated to include --debug and --trace in help output

Related Documents


Manual Validation

1. Verify --trace Flag for Fill Command

Run with --trace flag to capture incremental output to file:

markform fill examples/simple/simple.form.md \
 --mock --mock-source examples/simple/simple-mock-filled.form.md \
 --trace /tmp/fill-trace.log

Verify:

  • /tmp/fill-trace.log is created
  • File begins with header: # Markform Fill Trace Log
  • Header includes timestamp and model info
  • Turn info is logged: Turn 1: ...
  • Patches are logged with field IDs and values
  • Completion status is logged: Form completed in N turn(s)
  • Output file path is logged
  • ANSI color codes are stripped (no escape sequences in file)

2. Verify --trace Flag for Run Command

markform run examples/simple/simple.form.md \
 --trace /tmp/run-trace.log

Verify:

  • Trace file is created during form selection/execution
  • Header format matches fill command
  • All execution stages are logged

3. Verify --trace Flag for Research Command

markform research examples/movie-research/movie-research-demo.form.md \
 --model openai/gpt-5-mini \
 --trace /tmp/research-trace.log

Verify:

  • Trace file is created
  • Web search queries and results are logged
  • Token counts are logged

4. Verify MARKFORM_TRACE Environment Variable

MARKFORM_TRACE=/tmp/env-trace.log markform fill examples/simple/simple.form.md \
 --mock --mock-source examples/simple/simple-mock-filled.form.md

Verify:

  • Trace file is created at specified path
  • Works without --trace flag
  • --trace flag takes precedence over env var

5. Verify --debug Flag

Run with --debug flag to see enhanced output:

markform fill examples/movie-research/movie-research-demo.form.md \
 --model openai/gpt-5-mini \
 --debug

Verify:

  • Debug messages appear in magenta color
  • Raw tool input is shown after [tool_name] line
  • Raw tool output is shown after completion
  • System and context prompts are shown after patches

6. Verify --wire-log Flag

Run with --wire-log to capture wire format:

markform fill examples/movie-research/movie-research-demo.form.md \
 --model openai/gpt-5-mini \
 --wire-log /tmp/wire.yaml

Verify:

  • /tmp/wire.yaml is created
  • Contains sessionVersion, mode, modelId, formPath
  • Contains turns array with turn number and wire data
  • Wire data includes request with system/prompt and response with steps

7. Verify Combined Flags

Test multiple flags together:

markform fill examples/movie-research/movie-research-demo.form.md \
 --model openai/gpt-5-mini \
 --trace /tmp/combined-trace.log \
 --wire-log /tmp/combined-wire.yaml \
 --debug

Verify:

  • Both trace and wire log files are created
  • Console shows debug output
  • Trace file contains readable (non-colored) output
  • Wire file contains YAML-formatted request/response data

Edge Cases and Error Handling

  • Invalid trace path (e.g., /nonexistent/dir/trace.log) shows warning but doesn't crash
  • CLI flags take precedence over environment variables (MARKFORM_TRACE + --trace: --trace wins)

Automated Testing

  • 1455 unit tests pass - Full vitest test suite
  • 18 tryscript tests pass - CLI command integration tests including --help verification
  • Type checking passes - All 0 TypeScript errors
  • Lint passes - All 0 ESLint errors
  • Build succeeds - dist/ output verified

cmux-agent[bot] reacted with eyes emoji
Copy link
Contributor

github-actions bot commented Jan 5, 2026
edited
Loading

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 89.8% 31467 / 35040
🔵 Statements 89.8% 31467 / 35040
🔵 Functions 54.71% 29 / 53
🔵 Branches 59.37% 795 / 1339
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/markform/src/settings.ts 97.58% 25% 100% 97.58% 65-67, 71-74
packages/markform/src/cli/cli.ts 100% 100% 100% 100%
packages/markform/src/cli/commands/fill.ts 94.51% 34.04% 50% 94.51% 461-464, 495, 498, 557-571, 636-638, 658-669, 722-725
packages/markform/src/cli/commands/research.ts 34.13% 100% 100% 34.13% 85-248
packages/markform/src/cli/commands/run.ts 80.15% 100% 100% 80.15% 521-649
packages/markform/src/cli/lib/cliTypes.ts 0% 0% 0% 0% 1-136
packages/markform/src/cli/lib/fillLogging.ts 100% 100% 100% 100%
packages/markform/src/cli/lib/shared.ts 98.8% 56% 100% 98.8% 293, 295, 301-303
packages/markform/src/cli/lib/traceUtils.ts 100% 75% 100% 100%
packages/markform/src/engine/coreTypes.ts 100% 100% 100% 100%
packages/markform/src/harness/harnessTypes.ts 0% 0% 0% 0% 1-509
packages/markform/src/harness/liveAgent.ts 100% 92.59% 100% 100%
packages/markform/src/harness/programmaticFill.ts 100% 100% 100% 100%
packages/markform/src/harness/toolParsing.ts 100% 100% 100% 100%
packages/markform/src/research/runResearch.ts 100% 100% 100% 100%
packages/markform/src/utils/formatUtils.ts 100% 100% 100% 100%
Generated in workflow #623 for commit 1a1bb5f by the Vitest Coverage Report Action

Copy link

@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: 8c00cb07fd

i️ 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 +253 to +255
// Trace file: --trace flag or MARKFORM_TRACE env var
const traceFile = opts.trace ?? process.env.MARKFORM_TRACE;

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot Jan 5, 2026

Choose a reason for hiding this comment

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

P1 Badge Trace flag no-ops on markform fill

The new global --trace/MARKFORM_TRACE option is parsed into CommandContext.traceFile here, but the primary fill command never feeds that value into any logging callback—it still uses createCliToolCallbacks, which only write to the console. That means the example command in the commit message (markform fill ... --trace /tmp/fill-trace.log) never produces a trace file; only run/research benefit from tracing while fill silently ignores the flag.

Useful? React with 👍 / 👎.

String(DEFAULT_RESEARCH_MAX_ISSUES_PER_TURN),
)
.option('--transcript', 'Save session transcript')
.option('--wire-log <file>', 'Capture full wire format (LLM request/response) to YAML file')
Copy link
Owner Author

Choose a reason for hiding this comment

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

Why is this still --wire-log ? We said it would be --trace everywhere.

console.log(` ${schemaPath} ${pc.dim('(JSON Schema)')}`);

// Write wire log if requested (captures full LLM request/response)
if (wireLogPathOption && result.transcript) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

Similarly we should name the variables consistently so this would be tracePathOption

/**
* Strip ANSI escape codes from a string for file output.
*/
function stripAnsi(str: string): string {
Copy link
Owner Author

Choose a reason for hiding this comment

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

Why do we need to do this at all? If we're writing to a trace, we should be writing clean data to the trace not colorized or ANSI codes.

// Create logging callbacks
const callbacks = createFillLoggingCallbacks(ctx);
// Check for wire log (flag or env var)
const effectiveWireLogPath = wireLogPath ?? process.env.MARKFORM_WIRE_LOG;
Copy link
Owner Author

Choose a reason for hiding this comment

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

More names calling it WireLog. Let's call it Trace Everywhere. Search the codebase for WireLog and replace it with Trace. Do a case-insensitive search

)
.action(async (file: string | undefined, options: { limit?: string }, cmd: Command) => {
const ctx = getCommandContext(cmd);
.option('--wire-log <file>', 'Capture full wire format (LLM request/response) to YAML file')
Copy link
Owner Author

Choose a reason for hiding this comment

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

Again wrong name

/**
* Strip ANSI escape codes from a string for file output.
*/
function stripAnsi(str: string): string {
Copy link
Owner Author

Choose a reason for hiding this comment

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

You already implemented this elsewhere. If you do need these pull them out into a common shared library and only implement them once

/**
* Truncate a string to a maximum length with ellipsis indicator.
*/
function truncate(str: string, maxLength: number = DEBUG_OUTPUT_TRUNCATION_LIMIT): string {
Copy link
Owner Author

Choose a reason for hiding this comment

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

Same here. This is a common shared library. You should only ever implement it once and it should be in a general common utilities location so you never implement it again

/**
* Format duration in milliseconds to human-readable string.
*/
function formatDuration(ms: number): string {
Copy link
Owner Author

Choose a reason for hiding this comment

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

Same here, this is a common utility

/**
* Safely stringify an object for debug output.
*/
function safeStringify(obj: unknown): string {
Copy link
Owner Author

Choose a reason for hiding this comment

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

Again same here

package.json Outdated
"lefthook": "^2.0.13",
"prettier": "^3.7.4",
"tryscript": "0.1.1",
"tsx": "^4.21.0",
Copy link
Owner Author

Choose a reason for hiding this comment

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

Curious why did we need this? It's fine if we do but I didn't see where it was necessary

Copy link
Contributor

github-actions bot commented Jan 5, 2026
edited
Loading

Coverage Report for packages/markform

Status Category Percentage Covered / Total
🔵 Lines 63.15% (🎯 60%) 4290 / 6793
🔵 Statements 62.94% (🎯 60%) 4415 / 7014
🔵 Functions 66.24% (🎯 63%) 579 / 874
🔵 Branches 61.01% (🎯 58%) 3128 / 5127
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/markform/src/settings.ts 96.96% 93.33% 100% 98.27% 70-74, 226
packages/markform/src/cli/cli.ts 0% 100% 0% 0% 39-100
packages/markform/src/cli/commands/fill.ts 0% 0% 0% 0% 83-730
packages/markform/src/cli/lib/fillCallbacks.ts 0% 0% 0% 0% 51-105
packages/markform/src/cli/lib/fillLogging.ts 65.78% 58.94% 91.66% 67.28% 100-103, 117, 138-139, 145-147, 152-157, 177, 187-189, 204, 216-235, 245-247
packages/markform/src/cli/lib/shared.ts 29.03% 27.02% 36.66% 29.21% 78-168, 194-197, 223-266, 311-313, 350-377, 408-409
packages/markform/src/cli/lib/traceUtils.ts 35.71% 40% 50% 33.33% 48-49, 53-61
packages/markform/src/harness/liveAgent.ts 67.41% 52.04% 80.64% 67.46% 82, 93, 127, 132, 137, 170-171, 192-198, 214-215, 228-243, 264-273, 396-399, 406-412, 425, 470-473, 487-489, 653, 680-792
packages/markform/src/harness/programmaticFill.ts 88.42% 77.08% 80% 89.24% 45, 104, 184-185, 300-304, 321-326, 377, 403-409
packages/markform/src/harness/toolParsing.ts 2.59% 0% 0% 2.77% 29-263
packages/markform/src/utils/formatUtils.ts 23.07% 28.57% 40% 20% 20, 36, 56-73
Generated in workflow #655 for commit a8f4903 by the Vitest Coverage Report Action

jlevy pushed a commit that referenced this pull request Jan 5, 2026
Address PR review comments:
- Fix fill command --trace flag which was silently ignored (2660027464)
- Add trace file output to createCliToolCallbacks for tool/LLM/reasoning logs
- Move safeStringify() to shared formatUtils.ts library (2660068669)
- Re-export safeStringify from traceUtils.ts for convenience
All 11 PR #84 review comments are now fully addressed.
claude added 25 commits January 6, 2026 01:47
Comprehensive feature plan covering:
- Three logging levels (default, verbose, debug)
- Wire format capture via --wire-log flag
- Unified callback system across fill/research/run commands
...ements
- Add library-first callback design with structured tool info
- Define enhanced console progress display with search queries/results
- Add emoji indicators and timing information
- Update implementation phases and open questions
...e summaries
- Default mode shows tool calls with queries, timing, result counts, and sources
- Verbose adds top result titles, token counts, tool summary
- Updated FillCallbacks with sources and topResults fields
- Updated examples to reflect new logging levels
Design decisions finalized:
- Wire log format: unify with golden test transcript format
- Debug truncation: 500 chars, configurable in settings.ts
- LOG_LEVEL env var: equivalent to --debug flag
- Web search parsing: show first 5-8 result titles/domains
- Emoji usage: limited set per CLI best practices (✓ ❌ → [tool])
- Callback versioning: clean break, no backward compat
- Non-TTY progress: log lines instead of spinner
...onal details
Default mode now includes:
- Model and provider info at start
- Token counts per turn
- First 5-8 result titles from web search
- Tool summary at end of turn
- Patch validation warnings/errors
Verbose mode now focuses on operational details:
- Harness configuration
- Full web search result listings
- Patch accept/reject with reasons
- Validator execution details
- Form progress stats
Extend the plan spec with support for capturing AI SDK reasoning fields:
- Add WireResponseStep.reasoning field for step-level reasoning
- Add reasoningTokens to usage tracking
- Add onReasoningGenerated callback for library users
- Display reasoning in verbose/debug modes
- New Phase 5 for reasoning capture implementation
Also adds tsx as root dev dependency for running TypeScript scripts.
Based on AI SDK documentation research:
- reasoningText: final step reasoning
- steps[].reasoning: per-step reasoning array
- usage.reasoningTokens: token count for reasoning
- providerMetadata: provider-specific data
Updates to the CLI logging plan:
1. Clarify TTY detection uses existing infrastructure:
 - createSpinnerIfTty() already handles non-TTY
 - shouldUseColors() respects NO_COLOR and TTY
 - picocolors auto-detects - no new implementation needed
2. Add wire format content selection decision (#9):
 - Capture: toolCalls, toolResults, text, reasoning, usage, response.id/modelId
 - Skip: providerMetadata, response.messages (redundant), finishReason per step
 - Keeps wire logs focused and diffable
Based on AI SDK documentation research. Live API testing was blocked by
quota limits on both OpenAI and Anthropic accounts.
Complete Stage 5 validation section with:
Automated Test Coverage:
- Unit tests for logging utils, web search parsing, fill logging
- Callback interface tests for structured tool info
- Wire format tests for AI SDK response capture
- Integration tests for CLI output at each log level
- Cross-command consistency tests (fill, research, run)
- Golden tests for wire format and log level outputs
Manual Validation Checklist:
- Visual console output review at each log level
- TTY vs non-TTY behavior (colors, spinner, NO_COLOR)
- Wire log YAML review for completeness and diffability
- Environment variable behavior (LOG_LEVEL, MARKFORM_WIRE_LOG)
- Error handling scenarios
- Library API validation with TypeScript callbacks
- Cross-command visual comparison
- Documentation accuracy verification
Acceptance and Regression Checks:
- All 7 acceptance criteria from Stage 1
- 5 regression checks for existing behavior
Expands validation plan Stage 5 with senior-engineer-level test coverage:
- Edge cases: empty forms, large forms, Unicode, truncation boundaries
- Error paths: network failures, auth errors, file system errors, interrupts
- Security: API key redaction, PII handling, file permissions
- Performance: memory usage, I/O benchmarks, scalability targets
- Compatibility matrix: Node versions, OS, terminals, CI environments
- Graceful degradation: partial failures, missing features, backward compat
This PR implements the CLI logging improvements outlined in the plan spec:
- Added `LogLevel` type: quiet, default, verbose, debug
- Added `--debug` CLI flag for full diagnostic output
- Added `logDebug()` function for debug-level messages
- Added `MARKFORM_LOG_LEVEL` environment variable support
- Added `--wire-log <path>` flag to fill and research commands
- Added `MARKFORM_WIRE_LOG` environment variable support
- Captures full LLM request/response in YAML format
- Extended `FillCallbacks` with `toolType`, `query`, `resultCount`, `sources`, `topResults`
- Added `toolParsing.ts` with web search result extraction
- Shows search queries in yellow, results summary in default output
- Full result listings available in verbose mode
- Updated `fillLogging.ts` to respect all log levels
- Updated research command to use `createFillLoggingCallbacks`
- Consistent output format across fill and research commands
- New: `src/harness/toolParsing.ts`
- New: `docs/project/specs/active/valid-2026年01月04日-agent-cli-logging-improvements.md`
- Modified: CLI, harness, and test files
- All 1432 unit tests pass
- TypeScript strict mode passes
- ESLint with --max-warnings 0 passes
- Build succeeds
- Add WireReasoningContent type and reasoning field to WireResponseStep
- Add reasoningTokens to WireResponseFormat usage
- Extract reasoning from AI SDK responses in liveAgent
- Call onReasoningGenerated callback when reasoning present
- Include reasoning in wire format YAML output
- Trim plan spec validation section from 1158 to 764 lines
- Move detailed test checklists to validation spec reference
- Close markform-545 and markform-546 beads
- Add --wire-log flag to run command for consistency with fill/research
- Add transcript field to FillResult type for wire format capture
- Update programmaticFill to build transcript when captureWireFormat is enabled
- Add Log Levels and Wire Format Capture sections to development.md
- Update validation spec with run command testing and complete file list
- Add --trace flag for incremental file logging during execution
- Add MARKFORM_TRACE env var support for trace file
- Increase DEBUG_OUTPUT_TRUNCATION_LIMIT from 500 to 2000 chars
- Make truncation limit configurable via MARKFORM_DEBUG_TRUNCATION_LIMIT
- Fix run.ts to pass model info to createFillLoggingCallbacks
- Add traceFile support to research.ts callbacks
- Document logging system review findings
Trace file support allows monitoring long-running fills by writing
log output incrementally to a file (without ANSI colors), useful for
debugging and post-hoc analysis.
- Add trace file support to fill.ts command (addresses Codex review)
- Update tryscript tests to include new --debug and --trace options
- Update README test to use more flexible badge matching
The --trace flag was previously only working in run/research commands.
This fix adds the same incremental file logging support to the fill command.
- Add comprehensive manual validation steps for trace file feature
- Update test counts (1455 unit tests, 18 tryscript tests)
- Add edge cases and error handling verification steps
- Document combined flags testing scenarios
- Add potential issues to watch for section
...traceUtils
Per PR review feedback:
- Remove --wire-log flag from fill, research, and run commands
- Use only global --trace flag for all trace file output
- Create shared traceUtils.ts library with common utilities:
 - stripAnsi: Remove ANSI codes from strings for file output
 - createTracer: Create trace function for file logging
 - truncate: Truncate strings with ellipsis for debug output
 - formatDuration: Format milliseconds as human-readable
 - formatBytes: Format file sizes as human-readable
- Update fillLogging.ts to use shared utilities
- Remove duplicate code and unused imports
This reduces code duplication and provides a cleaner API where
trace output is controlled via the global --trace flag.
Add trace file output to the run command for consistency with
fill and research commands. Now all form-filling commands log
workflow configuration, completion status, and timing to the
trace file when --trace is specified.
Create reusable formatUtils.ts with general-purpose formatting utilities:
- stripAnsi: Remove ANSI escape codes from strings
- safeTruncate: Truncate strings with ellipsis (renamed from truncate)
- formatDuration: Format milliseconds as human-readable
- humanReadableSize: Format bytes as human-readable (renamed from formatBytes)
traceUtils.ts now imports from formatUtils.ts and re-exports for
backward compatibility. This allows these utilities to be reused
across the codebase, not just in CLI trace code.
Scripts use 'npx tsx' which works without a local dependency.
This was added unnecessarily in a previous commit.
- Support both 'text' and 'content' property names for reasoning items
 since different AI providers may use different property names
- Add fallback message when reasoning content is not available
- Add tests for reasoning callback in fillLogging
Add end-to-end tests for CLI logging at different verbosity levels:
- Default mode: shows turn and patch info
- Verbose mode: shows config details (max turns, patches, roles)
- Quiet mode: suppresses turn output
- Trace file: verifies file creation, header format, content
- Output verification: file creation and content checks
- User role fill with --roles flag
These tests run actual fill commands with mock agents and verify
the logging output matches expected patterns.
- Add test results table showing pass/fail status for all logging features
- Mark --quiet flag bug (markform-8): session transcript still printed
- Document completed manual testing for default, verbose, debug, trace modes
- Note live agent testing blocked by network issues
- Add bead markform-8 for quiet mode bug tracking
Address PR review comments:
- Fix fill command --trace flag which was silently ignored (2660027464)
- Add trace file output to createCliToolCallbacks for tool/LLM/reasoning logs
- Move safeStringify() to shared formatUtils.ts library (2660068669)
- Re-export safeStringify from traceUtils.ts for convenience
All 11 PR #84 review comments are now fully addressed.
Update validation plan with detailed test results from systematic testing:
- Mock mode at all log levels (default, quiet, verbose, debug)
- Trace file output with ANSI stripping verification
- Session recording (--record flag)
- Document known bug markform-8 (quiet mode doesn't suppress transcript)
- Add reviewer testing checklist for live agent tests
- Remove outdated --wire-log references (flag removed)
- Document all 11 PR review comments addressed
- Live agent testing now passing with GPT-4.1-mini
- Token counts, LLM call logging, tool tracking all verified
- Trace file captures all LLM/tool activity
- Required undici ProxyAgent for containerized environment
- All core logging features confirmed working
@jlevy jlevy force-pushed the claude/review-merge-cli-logging-HznVa branch from 6af6350 to 569bf03 Compare January 6, 2026 01:50
claude added 4 commits January 6, 2026 06:27
OpenAI's web_search tool executes server-side (no local execute function),
so the callback wrapping was skipping it. This fix:
1. Modified wrapToolsWithCallbacks to return both wrapped tools and set of
 wrapped tool names for tracking
2. Added code in step processing loop to fire onToolStart/onToolEnd
 callbacks for non-wrapped tools using step results
3. Fixed AI SDK type property names: input not args, output not result
This ensures [web_search] "query" and tool results are logged to console
during live agent execution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /