Skip to content

add IBM Bob agent adapter#102

Open
fredkwok-it wants to merge 2 commits into
nexu-io:mainfrom
fredkwok-it:add-bob-agent
Open

add IBM Bob agent adapter#102
fredkwok-it wants to merge 2 commits into
nexu-io:mainfrom
fredkwok-it:add-bob-agent

Conversation

@fredkwok-it

Copy link
Copy Markdown

Summary

Add support for IBM Bob Shell CLI as a new coding agent adapter.

Changes

  • next/src/lib/agents/detect.ts: Add bob agent definition with IBM vendor info and fallback models
  • next/src/lib/agents/argv.ts:
    • Add bob case in buildArgv() to use --output-format stream-json
    • Add bob parsing logic in parseLineWithState() to handle text/content/message fields
  • next/src/lib/agents/invoke.ts: Add prompt echo suppression to avoid duplicating system prompts in output
  • README.md: Update agent count badge (8 → 9 CLIs) and add IBM Bob to supported agents table
  • README.zh-CN.md: Update Chinese README with same changes

Testing

  • ✅ Bob CLI is installed and available at /opt/homebrew/bin/bob
  • ✅ Verified bob supports --output-format stream-json flag
  • ✅ Integration follows the same pattern as existing agents (qwen, opencode)

Implementation Details

Bob is invoked via stdin with stream-json output format, similar to other agents. The adapter reuses the existing JSON-line parser infrastructure and handles three common output fields: text, content, and message.

The implementation includes a workaround in invoke.ts to suppress prompt echo that bob may send back as the first streamed delta, preventing system prompt pollution in user-facing output.

Checklist

  • Agent adapter added to detect.ts
  • Command-line arguments configured in buildArgv()
  • Stream parser added in parseLineWithState()
  • README.md updated with agent entry
  • README.zh-CN.md updated with agent entry
  • Changes follow existing agent adapter patterns
  • No new dependencies added

References

Add support for IBM Bob Shell CLI as a new coding agent:

- Add bob agent definition in detect.ts with IBM vendor info
- Add bob case in buildArgv() to use --output-format stream-json
- Add bob parsing logic in parseLineWithState() to handle text/content/message fields
- Add prompt echo suppression in invoke.ts to avoid duplicating system prompts
- Update README.md and README.zh-CN.md agent tables and badge counts (8 → 9 CLIs)

Bob is invoked via stdin with stream-json output format, similar to other
agents. The adapter reuses the existing JSON-line parser infrastructure.
@lefarcen lefarcen requested a review from nettee June 5, 2026 01:29
@lefarcen lefarcen added size/S Small change: 20-99 changed lines risk/medium Medium risk change type/feature Feature or new user-facing capability labels Jun 5, 2026

@nettee nettee 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.

I found one blocking issue in the new Bob adapter. The inline comment has the concrete fix; the rest of the changed ranges looked consistent with the existing agent wiring.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

Comment thread next/src/lib/agents/argv.ts Outdated
case "bob":
// Bob's `-p`/`--prompt` flag expects an argument; we stream the prompt via
// stdin, so omit `-p` and just request stream-json output.
return ["--output-format", "stream-json"];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

IBM's Bob Shell docs say non-interactive output includes both the final answer and intermediary thinking by default, and they expose --hide-intermediary-output specifically to limit stdout to the final completion output. This adapter only adds --output-format stream-json, while the new Bob parser below forwards every top-level text / content / message string into the preview. In practice that means Bob's reasoning and tool chatter can be appended straight into the generated HTML or markdown, which breaks the user-visible document instead of just adding metadata. Please either add --hide-intermediary-output here or tighten the Bob parser to emit only final assistant content, and add a regression test in next/src/lib/agents/__tests__/argv.test.ts that covers a "thinking + final answer" Bob stream.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

Add --hide-intermediary-output flag to Bob adapter to suppress thinking
and reasoning output, preventing intermediary text from polluting the
final HTML/markdown document.

Changes:
- Add --hide-intermediary-output to buildArgv() for bob agent
- Add regression tests in argv.test.ts covering Bob stream-json parsing
- Update README.md and README.zh-CN.md with correct invocation

This addresses the review feedback from nettee about blocking issue
where Bob's reasoning could be appended into generated artifacts.
@fredkwok-it

Copy link
Copy Markdown
Author

Thanks for the review! I've addressed the feedback:

Added --hide-intermediary-output flag to the Bob adapter in buildArgv() to suppress thinking/reasoning output
Added regression tests in argv.test.ts covering Bob's stream-json parsing, including a test case for the final answer scenario
Updated both READMEs with the correct invocation command

The flag ensures that only the final completion output is sent to stdout, preventing Bob's intermediary thinking from polluting the generated HTML/markdown artifacts.

All tests pass locally (pnpm -F @html-anything/next test).

Ready for re-review!

@nettee nettee 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.

@fredkwok-it I rechecked the Bob follow-up commit against the changed ranges. The adapter now hides intermediary output, the supported-agent/docs updates are consistent, and the Bob parser coverage added here matches the current adapter shape. Nice follow-through on the review feedback.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/medium Medium risk change size/S Small change: 20-99 changed lines type/feature Feature or new user-facing capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants